mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-03 06:51:11 +00:00
Merge branch 'firefire' into 'next'
Hide shield overlays and not just the shield while shieldscale zero (resolves #1340) Closes #1340 See merge request STJr/SRB2!2581
This commit is contained in:
commit
fe79717d99
1 changed files with 8 additions and 2 deletions
10
src/p_mobj.c
10
src/p_mobj.c
|
@ -6639,12 +6639,12 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield)
|
||||||
if (scale < 1) {
|
if (scale < 1) {
|
||||||
P_SetScale(thing, thing->target->scale, true);
|
P_SetScale(thing, thing->target->scale, true);
|
||||||
thing->old_scale = thing->target->old_scale;
|
thing->old_scale = thing->target->old_scale;
|
||||||
|
|
||||||
thing->flags2 |= (MF2_DONTDRAW|MF2_JUSTATTACKED); //Hide and indicate we're hidden
|
thing->flags2 |= (MF2_DONTDRAW|MF2_JUSTATTACKED); //Hide and indicate we're hidden
|
||||||
} else {
|
} else {
|
||||||
P_SetScale(thing, scale, true);
|
P_SetScale(thing, scale, true);
|
||||||
thing->old_scale = FixedMul(thing->target->old_scale, thing->target->player->shieldscale);
|
thing->old_scale = FixedMul(thing->target->old_scale, thing->target->player->shieldscale);
|
||||||
|
|
||||||
//Only unhide if we were hidden by the above code
|
//Only unhide if we were hidden by the above code
|
||||||
if (thing->flags2 & MF2_JUSTATTACKED)
|
if (thing->flags2 & MF2_JUSTATTACKED)
|
||||||
thing->flags2 &= ~(MF2_DONTDRAW|MF2_JUSTATTACKED);
|
thing->flags2 &= ~(MF2_DONTDRAW|MF2_JUSTATTACKED);
|
||||||
|
@ -6773,6 +6773,12 @@ void P_RunOverlays(void)
|
||||||
else
|
else
|
||||||
zoffs = 0;
|
zoffs = 0;
|
||||||
|
|
||||||
|
// hide the overlay as well if we're part of a hidden shield
|
||||||
|
if ((mo->target->flags2 & (MF2_JUSTATTACKED|MF2_DONTDRAW)) == (MF2_JUSTATTACKED|MF2_DONTDRAW))
|
||||||
|
mo->flags2 |= (MF2_DONTDRAW|MF2_JUSTATTACKED);
|
||||||
|
else if (mo->flags2 & MF2_JUSTATTACKED)
|
||||||
|
mo->flags2 &= ~(MF2_DONTDRAW|MF2_JUSTATTACKED);
|
||||||
|
|
||||||
P_UnsetThingPosition(mo);
|
P_UnsetThingPosition(mo);
|
||||||
mo->x = mo->target->x;
|
mo->x = mo->target->x;
|
||||||
mo->y = mo->target->y;
|
mo->y = mo->target->y;
|
||||||
|
|
Loading…
Reference in a new issue