- The FlagLists structure cannot be anonymous if I want to use countof with it with GCC.
- Added a stopping check to A_ChangeVelocity. SVN r1699 (trunk)
This commit is contained in:
parent
8554ccf2a3
commit
9bf7c02194
2 changed files with 24 additions and 10 deletions
|
|
@ -2040,6 +2040,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_Stop)
|
|||
}
|
||||
}
|
||||
|
||||
static void CheckStopped(AActor *self)
|
||||
{
|
||||
if (self->player != NULL &&
|
||||
self->player->mo == self &&
|
||||
!(self->player->cheats & CF_PREDICTING) &&
|
||||
!(self->velx | self->vely | self->velz))
|
||||
{
|
||||
self->player->mo->PlayIdle();
|
||||
self->player->velx = self->player->vely = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_Respawn
|
||||
|
|
@ -2610,14 +2622,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ScaleVelocity)
|
|||
|
||||
// If the actor was previously moving but now is not, and is a player,
|
||||
// update its player variables. (See A_Stop.)
|
||||
if (was_moving &&
|
||||
self->player != NULL &&
|
||||
self->player->mo == self &&
|
||||
!(self->player->cheats & CF_PREDICTING) &&
|
||||
!(self->velx | self->vely | self->velz))
|
||||
if (was_moving)
|
||||
{
|
||||
self->player->mo->PlayIdle();
|
||||
self->player->velx = self->player->vely = 0;
|
||||
CheckStopped(self);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2635,6 +2642,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeVelocity)
|
|||
ACTION_PARAM_FIXED(z, 2);
|
||||
ACTION_PARAM_INT(flags, 3);
|
||||
|
||||
INTBOOL was_moving = self->velx | self->vely | self->velz;
|
||||
|
||||
fixed_t vx = x, vy = y, vz = z;
|
||||
fixed_t sina = finesine[self->angle >> ANGLETOFINESHIFT];
|
||||
fixed_t cosa = finecosine[self->angle >> ANGLETOFINESHIFT];
|
||||
|
|
@ -2656,4 +2665,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeVelocity)
|
|||
self->vely += vy;
|
||||
self->velz += vz;
|
||||
}
|
||||
|
||||
if (was_moving)
|
||||
{
|
||||
CheckStopped(self);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue