X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=88d531ae9ac8ce4503e6b85d09d58b09089403d7;hb=be255d5426e17de0dc4beb8c423e780ebd9e617b;hp=d9ca813aa372a3dc331704ef168254d0e68475b7;hpb=2a718ebca6aed499161fc61b8ec3ebf0abc110c1;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index d9ca813aa..88d531ae9 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -11,6 +11,7 @@ #include "command/sv_cmd.qh" #include "command/vote.qh" #include "g_hook.qh" +#include #include "ipban.qh" #include "mapvoting.qh" #include @@ -22,6 +23,7 @@ #include "../common/constants.qh" #include #include "../common/deathtypes/all.qh" +#include #include "../common/gamemodes/sv_rules.qh" #include "../common/mapinfo.qh" #include "../common/monsters/_mod.qh" @@ -259,6 +261,7 @@ void cvar_changes_init() BADCVAR("g_ca"); BADCVAR("g_ca_teams"); BADCVAR("g_conquest"); + BADCVAR("g_conquest_teams"); BADCVAR("g_ctf"); BADCVAR("g_cts"); BADCVAR("g_dotc"); @@ -286,6 +289,8 @@ void cvar_changes_init() BADCVAR("g_runematch"); BADCVAR("g_shootfromeye"); BADCVAR("g_snafu"); + BADCVAR("g_survival"); + BADCVAR("g_survival_not_dm_maps"); BADCVAR("g_tdm"); BADCVAR("g_tdm_on_dm_maps"); BADCVAR("g_tdm_teams"); @@ -294,6 +299,7 @@ void cvar_changes_init() BADCVAR("nextmap"); BADCVAR("teamplay"); BADCVAR("timelimit"); + BADCVAR("g_mapinfo_settemp_acl"); BADCVAR("g_mapinfo_ignore_warnings"); BADCVAR("g_maplist_ignore_sizes"); BADCVAR("g_maplist_sizes_count_bots"); @@ -332,6 +338,7 @@ void cvar_changes_init() BADCVAR("g_buffs_randomize"); BADCVAR("g_buffs_randomize_teamplay"); BADCVAR("g_campcheck_distance"); + BADCVAR("g_chatsounds"); BADCVAR("g_ca_point_leadlimit"); BADCVAR("g_ca_point_limit"); BADCVAR("g_ctf_captimerecord_always"); @@ -344,9 +351,13 @@ void cvar_changes_init() BADCVAR("g_forced_respawn"); BADCVAR("g_freezetag_point_leadlimit"); BADCVAR("g_freezetag_point_limit"); + BADCVAR("g_glowtrails"); BADCVAR("g_hats"); + BADCVAR("g_casings"); BADCVAR("g_invasion_point_limit"); BADCVAR("g_jump_grunt"); + BADCVAR("g_keepaway_ballcarrier_effects"); + BADCVAR("g_keepawayball_effects"); BADCVAR("g_keyhunt_point_leadlimit"); BADCVAR("g_nexball_goalleadlimit"); BADCVAR("g_new_toys_autoreplace"); @@ -369,10 +380,12 @@ void cvar_changes_init() BADCVAR("sv_minigames"); BADCVAR("sv_namechangetimer"); BADCVAR("sv_precacheplayermodels"); + BADCVAR("sv_radio"); BADCVAR("sv_stepheight"); BADCVAR("sv_timeout"); BADCVAR("sv_weapons_modeloverride"); BADCVAR("w_prop_interval"); + BADPREFIX("chat_"); BADPREFIX("crypto_"); BADPREFIX("gameversion_"); BADPREFIX("g_chat_"); @@ -568,9 +581,6 @@ spawnfunc(__init_dedicated_server) // handler for _init/_init map (only for dedicated server initialization) world_initialized = -1; // don't complain - cvar = cvar_normal; - cvar_string = cvar_string_normal; - cvar_set = cvar_set_normal; delete_fn = remove_unsafely; @@ -680,8 +690,8 @@ spawnfunc(worldspawn) // localcmd("\nfs_rescan\n"); // FIXME: does more harm than good, has unintended side effects. What we really want is to unload temporary pk3s only // restore csqc_progname too string expect = "csprogs.dat"; - wantrestart = cvar_string_normal("csqc_progname") != expect; - cvar_set_normal("csqc_progname", expect); + wantrestart = cvar_string("csqc_progname") != expect; + cvar_set("csqc_progname", expect); } else { @@ -692,9 +702,9 @@ spawnfunc(worldspawn) // This always works; fall back to it if a versioned csprogs.dat is suddenly missing string select = "csprogs.dat"; if (fexists(pk3csprogs)) select = pk3csprogs; - if (cvar_string_normal("csqc_progname") != select) + if (cvar_string("csqc_progname") != select) { - cvar_set_normal("csqc_progname", select); + cvar_set("csqc_progname", select); wantrestart = true; } // Check for updates on startup @@ -713,13 +723,13 @@ spawnfunc(worldspawn) string newprogs = sprintf("progs-%s.dat", switchversion); if (fexists(newprogs)) { - cvar_set_normal("sv_progs", newprogs); + cvar_set("sv_progs", newprogs); wantrestart = true; } string newcsprogs = sprintf("csprogs-%s.dat", switchversion); if (fexists(newcsprogs)) { - cvar_set_normal("csqc_progname", newcsprogs); + cvar_set("csqc_progname", newcsprogs); wantrestart = true; } } @@ -733,10 +743,6 @@ spawnfunc(worldspawn) } } - cvar = cvar_normal; - cvar_string = cvar_string_normal; - cvar_set = cvar_set_normal; - if(world_already_spawned) error("world already spawned - you may have EXACTLY ONE worldspawn!"); world_already_spawned = true; @@ -2067,21 +2073,20 @@ void Physics_Frame() IL_EACH(g_moveables, true, { - if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_PUSH || it.move_movetype == MOVETYPE_FAKEPUSH || it.move_movetype == MOVETYPE_PHYSICS) + if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_PHYSICS) continue; //set_movetype(it, it.move_movetype); // inline the set_movetype function, since this is called a lot - it.movetype = (it.move_qcphysics) ? MOVETYPE_NONE : it.move_movetype; - - if(it.move_movetype == MOVETYPE_NONE) - continue; + it.movetype = (it.move_qcphysics) ? MOVETYPE_QCENTITY : it.move_movetype; - if(it.move_qcphysics) + if(it.move_qcphysics && it.move_movetype != MOVETYPE_NONE) Movetype_Physics_NoMatchTicrate(it, PHYS_INPUT_TIMELENGTH, false); if(it.movetype >= MOVETYPE_USER_FIRST && it.movetype <= MOVETYPE_USER_LAST) // these cases have no think handling { + if(it.move_movetype == MOVETYPE_PUSH || it.move_movetype == MOVETYPE_FAKEPUSH) + continue; // these movetypes have no regular think function // handle thinking here if (getthink(it) && it.nextthink > 0 && it.nextthink <= time + frametime) RunThink(it); @@ -2093,7 +2098,7 @@ void Physics_Frame() IL_EACH(g_moveables, it.move_qcphysics, { - if(IS_CLIENT(it) || is_pure(it) || it.classname == "" || it.move_movetype == MOVETYPE_NONE) + if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_NONE) continue; Movetype_Physics_NoMatchTicrate(it, PHYS_INPUT_TIMELENGTH, false); }); @@ -2213,6 +2218,11 @@ void Shutdown() if(world_initialized > 0) { world_initialized = 0; + + // if a timeout is active, reset the slowmo value to normal + if(timeout_status == TIMEOUT_ACTIVE) + cvar_set("slowmo", ftos(orig_slowmo)); + LOG_TRACE("Saving persistent data..."); Ban_SaveBans();