Generalized the psprites implementation

This commit is contained in:
Leonard2 2016-05-09 20:03:47 +02:00
commit 1966b61b8f
25 changed files with 744 additions and 478 deletions

View file

@ -5706,15 +5706,18 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTics)
PARAM_ACTION_PROLOGUE;
PARAM_INT(tics_to_set);
if (stateowner != self && self->player != NULL && stateowner->IsKindOf(RUNTIME_CLASS(AWeapon)))
{ // Is this a weapon? Need to check psp states for a match, then. Blah.
for (int i = 0; i < NUMPSPRITES; ++i)
if (stateowner != self && self->player != nullptr && stateowner->IsKindOf(RUNTIME_CLASS(AInventory)))
{ // Need to check psp states for a match, then. Blah.
DPSprite *pspr = self->player->psprites;
while (pspr)
{
if (self->player->psprites[i].state == callingstate)
if (pspr->GetState() == callingstate)
{
self->player->psprites[i].tics = tics_to_set;
pspr->Tics = tics_to_set;
return 0;
}
pspr = pspr->GetNext();
}
}
// Just set tics for self.