X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fworld.qc;h=ca395209759edfa394a1d08b5157391239beb559;hb=323105d51f8eb6dea47c063965be5e34ad57f987;hp=fca7c1741497e7a092245ad376744a1b3e4b630a;hpb=dad0572b6112ed622fd0c19850e9036867f8833b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index fca7c1741..ca3952097 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -279,7 +279,6 @@ void cvar_changes_init() BADCVAR("g_duel_not_dm_maps"); BADCVAR("g_freezetag"); BADCVAR("g_freezetag_teams"); - BADCVAR("g_invasion_teams"); BADCVAR("g_invasion_type"); BADCVAR("g_jailbreak"); BADCVAR("g_jailbreak_teams"); @@ -1033,7 +1032,7 @@ spawnfunc(light) delete(this); } -bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance) +bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance, bool frompos) { float m = e.dphitcontentsmask; e.dphitcontentsmask = goodcontents | badcontents; @@ -1091,14 +1090,22 @@ bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax // rule 4: we must "see" some spawnpoint or item entity sp = NULL; - IL_EACH(g_spawnpoints, checkpvs(mstart, it), + if(frompos) { - if((traceline(mstart, it.origin, MOVE_NORMAL, e), trace_fraction) >= 1) - { - sp = it; - break; - } - }); + if((traceline(mstart, e.origin, MOVE_NORMAL, e), trace_fraction) >= 1) + sp = e; + } + if(!sp) + { + IL_EACH(g_spawnpoints, checkpvs(mstart, it), + { + if((traceline(mstart, it.origin, MOVE_NORMAL, e), trace_fraction) >= 1) + { + sp = it; + break; + } + }); + } if(!sp) { int items_checked = 0; @@ -1157,7 +1164,7 @@ bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance) { - return MoveToRandomLocationWithinBounds(e, world.mins, world.maxs, goodcontents, badcontents, badsurfaceflags, attempts, maxaboveground, minviewdistance); + return MoveToRandomLocationWithinBounds(e, world.mins, world.maxs, goodcontents, badcontents, badsurfaceflags, attempts, maxaboveground, minviewdistance, false); } /*