mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Calculate thing state only once
This commit is contained in:
parent
d7c80af490
commit
f03d9f6dec
1 changed files with 7 additions and 7 deletions
14
src/p_spec.c
14
src/p_spec.c
|
|
@ -3165,21 +3165,21 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
|
||||||
case 425: // Calls P_SetMobjState on calling mobj
|
case 425: // Calls P_SetMobjState on calling mobj
|
||||||
{
|
{
|
||||||
mobj_t *targetThing = NULL;
|
mobj_t *targetThing = NULL;
|
||||||
|
statenum_t state = stringargs[0] ? get_number(stringargs[0]) : S_NULL;
|
||||||
|
|
||||||
|
if (state < 0 || state >= NUMSTATES)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
while ((targetThing = P_FindMobjFromTID(args[1], targetThing, mo)) != NULL)
|
while ((targetThing = P_FindMobjFromTID(args[1], targetThing, mo)) != NULL)
|
||||||
{
|
{
|
||||||
statenum_t state = S_NULL;
|
|
||||||
|
|
||||||
if (targetThing->player != NULL)
|
if (targetThing->player != NULL)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
state = stringargs[0] ? get_number(stringargs[0]) : S_NULL;
|
P_SetMobjState(targetThing, state);
|
||||||
if (state >= 0 && state < NUMSTATES)
|
|
||||||
{
|
|
||||||
P_SetMobjState(targetThing, state);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue