- Added PinkSilver's SetActorVelocity code submission (with optimizations.)

SVN r1799 (trunk)
This commit is contained in:
Christoph Oelckers 2009-09-06 08:27:18 +00:00
commit 93f6f1d701
4 changed files with 41 additions and 0 deletions

View file

@ -478,6 +478,26 @@ bool P_Thing_Raise(AActor *thing)
return true;
}
void P_Thing_SetVelocity(AActor *actor, fixed_t vx, fixed_t vy, fixed_t vz, bool add)
{
if (actor != NULL)
{
if (!add)
{
actor->velx = actor->vely = actor->velz = 0;
if (actor->player != NULL) actor->player->velx = actor->player->vely = 0;
}
actor->velx += vx;
actor->vely += vy;
actor->velz += vz;
if (actor->player != NULL)
{
actor->player->velx += vx;
actor->player->vely += vy;
}
}
}
CCMD (dumpspawnables)
{