X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ft_jumppads.qc;h=8923c19f18300e1f742acd0586e61539744c3c15;hb=a9a7db34cf93f756ae42925c302cec84f9f9b7d2;hp=64dc74b9840b52524495488dd4a31685878ad7d3;hpb=585387cb47119277a6c3edfeea4a9bcff17481f8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/t_jumppads.qc b/qcsrc/server/t_jumppads.qc index 64dc74b98..8923c19f1 100644 --- a/qcsrc/server/t_jumppads.qc +++ b/qcsrc/server/t_jumppads.qc @@ -2,6 +2,7 @@ float PUSH_ONCE = 1; float PUSH_SILENT = 2; .float pushltime; +.float istypefrag; .float height; void() SUB_UseTargets; @@ -30,8 +31,8 @@ void trigger_push_use() vector trigger_push_calculatevelocity(vector org, entity tgt, float ht) { - local float grav, sdist, zdist, vs, vz, jumpheight; - local vector sdir, torg; + float grav, sdist, zdist, vs, vz, jumpheight; + vector sdir, torg; torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5; @@ -127,8 +128,6 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht) void trigger_push_touch() { - vector move; - if (self.active == ACTIVE_NOT) return; @@ -177,12 +176,12 @@ void trigger_push_touch() sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM); self.pushltime = time + 0.2; } - local float ct; + float ct; ct = clienttype(other); if( ct == CLIENTTYPE_REAL || ct == CLIENTTYPE_BOT) { - local float i; - local float found; + float i; + float found; found = FALSE; for(i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i) if(other.(jumppadsused[i]) == self) @@ -202,6 +201,7 @@ void trigger_push_touch() other.lastteleporttime = time; if (!other.animstate_override) + if (other.deadflag == DEAD_NO) { if (other.crouch) setanim(other, other.anim_duckjump, FALSE, TRUE, TRUE); @@ -214,6 +214,7 @@ void trigger_push_touch() // reset tracking of who pushed you into a hazard (for kill credit) other.pushltime = 0; + other.istypefrag = 0; } if(self.enemy.target) @@ -249,14 +250,13 @@ void trigger_push_touch() self.think = SUB_Remove; self.nextthink = time; } -}; +} .vector dest; void trigger_push_findtarget() { - local entity e, t; - local vector org; - local float flighttime; + entity e, t; + vector org; // first calculate a typical start point for the jump org = (self.absmin + self.absmax) * 0.5; @@ -288,7 +288,7 @@ void trigger_push_findtarget() else if(n == 1) { // exactly one dest - bots love that - self.enemy = find(e, targetname, self.target); + self.enemy = find(world, targetname, self.target); } else { @@ -306,7 +306,7 @@ void trigger_push_findtarget() waypoint_spawnforteleporter(self, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity)); remove(e); } -}; +} /* * ENTITY PARAMETERS: @@ -341,8 +341,8 @@ void spawnfunc_trigger_push() // this must be called to spawn the teleport waypoints for bots InitializeEntity(self, trigger_push_findtarget, INITPRIO_FINDTARGET); -}; +} -void spawnfunc_target_push() {}; -void spawnfunc_info_notnull() {}; -void spawnfunc_target_position() {}; +void spawnfunc_target_push() {} +void spawnfunc_info_notnull() {} +void spawnfunc_target_position() {}