mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix code formatting in P_SetTarget
This commit is contained in:
parent
cd7d4f23c7
commit
55467d190a
1 changed files with 10 additions and 2 deletions
10
src/p_tick.c
10
src/p_tick.c
|
|
@ -311,9 +311,17 @@ void P_RemoveThinker(thinker_t *thinker)
|
||||||
mobj_t *P_SetTarget(mobj_t **mop, mobj_t *targ)
|
mobj_t *P_SetTarget(mobj_t **mop, mobj_t *targ)
|
||||||
{
|
{
|
||||||
if (*mop) // If there was a target already, decrease its refcount
|
if (*mop) // If there was a target already, decrease its refcount
|
||||||
|
{
|
||||||
(*mop)->thinker.references--;
|
(*mop)->thinker.references--;
|
||||||
if ((*mop = targ) != NULL) // Set new target and if non-NULL, increase its counter
|
}
|
||||||
|
|
||||||
|
if (targ != NULL) // Set new target and if non-NULL, increase its counter
|
||||||
|
{
|
||||||
targ->thinker.references++;
|
targ->thinker.references++;
|
||||||
|
}
|
||||||
|
|
||||||
|
*mop = targ;
|
||||||
|
|
||||||
return targ;
|
return targ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue