X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ft_jumppads.qc;h=18dbef1711424dd28e5864c58fc0adc0d30d2112;hb=107c1ba5b57973f8b18c3fc9fc3f632ca72470de;hp=9bb8f7c92034d88e0de65ba2f88e0039ed4f53f5;hpb=07c6b6356a0c24dcc4c3b7468728b6d96014d446;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/t_jumppads.qc b/qcsrc/server/t_jumppads.qc index 9bb8f7c92..18dbef171 100644 --- a/qcsrc/server/t_jumppads.qc +++ b/qcsrc/server/t_jumppads.qc @@ -10,7 +10,7 @@ float trigger_push_calculatevelocity_flighttime; void trigger_push_use() { - if(teams_matter) + if(teamplay) self.team = activator.team; } @@ -35,7 +35,7 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht) torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5; - grav = cvar("sv_gravity"); + grav = autocvar_sv_gravity; zdist = torg_z - org_z; sdist = vlen(torg - org - zdist * '0 0 1'); @@ -127,17 +127,10 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht) void trigger_push_touch() { - // FIXME: add a .float for whether an entity should be tossed by jumppads - if (!other.iscreature) - if (other.classname != "corpse") - if (other.classname != "body") - if (other.classname != "gib") - if (other.classname != "casing") - if (other.classname != "droppedweapon") - if (!other.projectiledeathtype || other.classname == "bullet") + if (self.active == ACTIVE_NOT) return; - if (other.deadflag && other.iscreature) + if (!isPushable(other)) return; if(self.team) @@ -162,12 +155,12 @@ void trigger_push_touch() { // flash when activated pointparticles(particleeffectnum("jumppad_activate"), other.origin, other.velocity, 1); - sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM); + sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM); self.pushltime = time + 0.2; } local float ct; ct = clienttype(other); - if( ct == CLIENTTYPE_REAL) + if( ct == CLIENTTYPE_REAL || ct == CLIENTTYPE_BOT) { local float i; local float found; @@ -181,11 +174,14 @@ void trigger_push_touch() other.jumppadcount = other.jumppadcount + 1; } - if(self.message) - centerprint(other, self.message); + if(ct == CLIENTTYPE_REAL) + { + if(self.message) + centerprint(other, self.message); + } + else + other.lastteleporttime = time; } - else if(ct == CLIENTTYPE_BOT) - other.lastteleporttime = time; else other.jumppadcount = TRUE; @@ -229,7 +225,6 @@ void trigger_push_touch() }; .vector dest; - void trigger_push_findtarget() { local entity e; @@ -283,11 +278,11 @@ void trigger_push_findtarget() */ void spawnfunc_trigger_push() { - if (self.angles != '0 0 0') - SetMovedir (); + SetMovedir (); EXACTTRIGGER_INIT; + self.active = ACTIVE_ACTIVE; self.use = trigger_push_use; self.touch = trigger_push_touch;