2007-09-04 22:00:00 +02:00
|
|
|
/*
|
|
|
|
+============+
|
|
|
|
|TRIGGER_PUSH|
|
|
|
|
+============+==============+
|
|
|
|
|Description; |
|
2007-09-16 22:00:00 +02:00
|
|
|
|Push player for pev speed.|
|
2007-09-04 22:00:00 +02:00
|
|
|
+===========================+
|
|
|
|
*/
|
|
|
|
void() trigger_push_think =
|
|
|
|
{
|
2007-09-16 22:00:00 +02:00
|
|
|
pev->touched = FALSE;
|
2007-09-04 22:00:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
void() trigger_push_touch =
|
|
|
|
{
|
|
|
|
if(other.flags & FL_CLIENT)
|
2007-09-16 22:00:00 +02:00
|
|
|
other.velocity = pev->speed * pev->movedir * 10;
|
2007-09-04 22:00:00 +02:00
|
|
|
|
2007-09-16 22:00:00 +02:00
|
|
|
if (pev->spawnflags & TRIGGER_ONCE)
|
|
|
|
remove(pev);
|
2007-09-04 22:00:00 +02:00
|
|
|
|
2007-09-16 22:00:00 +02:00
|
|
|
if(pev->dmg)
|
2007-09-04 22:00:00 +02:00
|
|
|
{
|
2007-09-16 22:00:00 +02:00
|
|
|
if(pev->touched == FALSE)
|
2007-09-04 22:00:00 +02:00
|
|
|
{
|
2007-09-16 22:00:00 +02:00
|
|
|
T_Damage (other, pev, pev, pev->dmg);
|
|
|
|
pev->touched = TRUE;
|
2007-09-04 22:00:00 +02:00
|
|
|
|
2007-09-16 22:00:00 +02:00
|
|
|
pev->think = trigger_push_think;
|
|
|
|
pev->nextthink = time + 0.1;
|
2007-09-04 22:00:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
void() trigger_push =
|
|
|
|
{
|
|
|
|
trigger_setup();
|
|
|
|
|
2007-09-16 22:00:00 +02:00
|
|
|
pev->touch = trigger_push_touch;
|
2007-09-04 22:00:00 +02:00
|
|
|
|
2007-09-16 22:00:00 +02:00
|
|
|
if (!pev->speed)
|
|
|
|
pev->speed = 1000;
|
2007-09-04 22:00:00 +02:00
|
|
|
|
2007-09-16 22:00:00 +02:00
|
|
|
pev->classname = "t_push";
|
2007-09-04 22:00:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|