This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/vprogs/ents/triggers/trigger_push.c

48 lines
766 B
C

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