void trigger_push_use()
{
- if(teams_matter)
+ if(teamplay)
self.team = activator.team;
}
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');
void trigger_push_touch()
{
- if (self.active == ACTIVE_NOT)
- return;
-
- // 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.classname != "keepawayball")
- if (!other.projectiledeathtype || other.classname == "bullet")
+ if (self.active == ACTIVE_NOT)
return;
- if (other.deadflag && other.iscreature)
+ if (!isPushable(other))
return;
if(self.team)
{
// 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;
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;
*/
void spawnfunc_trigger_push()
{
- if (self.angles != '0 0 0')
- SetMovedir ();
+ SetMovedir ();
EXACTTRIGGER_INIT;
-
- self.active = ACTIVE_ACTIVE;
+
+ self.active = ACTIVE_ACTIVE;
self.use = trigger_push_use;
self.touch = trigger_push_touch;