X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmiscfunctions.qc;h=a2ed8cdda7d76f477b9c0cc0c9c4b49523aa38d2;hb=2e60d4af0278db5d39618bf8fee353c220d90486;hp=c68d1a679aaee61c210b496c3c0aa1cc7e980982;hpb=af43b181a15f348a4de2045b716ebc7765ce8f9f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index c68d1a679..a2ed8cdda 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -400,6 +400,8 @@ REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating"); REPLICATE(cvar_cl_handicap, float, "cl_handicap"); +REPLICATE(cvar_cl_gunalign, int, "cl_gunalign"); + REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump"); REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump"); @@ -1194,11 +1196,6 @@ bool WarpZone_Projectile_Touch_ImpactFilter_Callback(entity this, entity toucher return false; // no checks here else if(this.classname == "grapplinghook") RemoveHook(this); - else if(this.classname == "spike") - { - W_Crylink_Dequeue(this); - delete(this); - } else delete(this); return true; @@ -1260,7 +1257,7 @@ string uid2name(string myuid) { return s; } -float MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, float 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, i; vector start, org, delta, end, enddown, mstart; @@ -1320,14 +1317,22 @@ float MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundma // 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; @@ -1385,9 +1390,9 @@ float MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundma return false; } -float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance) +bool MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, int 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); } void write_recordmarker(entity pl, float tstart, float dt)