- turning one check in hitradius into a flag.

This commit is contained in:
Christoph Oelckers 2021-12-29 23:38:53 +01:00
parent 5061d5b37c
commit f9cea2b1db
5 changed files with 30 additions and 9 deletions

View file

@ -398,13 +398,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
act2->spr.xvel += (actor->spr.extra << 2);
}
if (act2->spr.picnum == PODFEM1 || act2->spr.picnum == FEM1 ||
act2->spr.picnum == FEM2 || act2->spr.picnum == FEM3 ||
act2->spr.picnum == FEM4 || act2->spr.picnum == FEM5 ||
act2->spr.picnum == FEM6 || act2->spr.picnum == FEM7 ||
act2->spr.picnum == FEM8 || act2->spr.picnum == FEM9 ||
act2->spr.picnum == FEM10 || act2->spr.picnum == STATUE ||
act2->spr.picnum == STATUEFLASH || act2->spr.picnum == SPACEMARINE || act2->spr.picnum == QUEBALL || act2->spr.picnum == STRIPEBALL)
if (gs.actorinfo[act2->spr.picnum].flags & SFLAG_HITRADIUSCHECK)
fi.checkhitsprite(act2, actor);
}
else if (actor->spr.extra == 0) act2->extra = 0;

View file

@ -335,8 +335,7 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
act2->spr.xvel += (act2->spr.extra << 2);
}
if (act2->spr.picnum == STATUEFLASH || act2->spr.picnum == QUEBALL ||
act2->spr.picnum == STRIPEBALL || act2->spr.picnum == BOWLINGPIN)
if (gs.actorinfo[act2->spr.picnum].flags & SFLAG_HITRADIUSCHECK)
fi.checkhitsprite(act2, actor);
if (act2->spr.picnum != RADIUSEXPLOSION &&

View file

@ -311,6 +311,7 @@ enum sflags_t
SFLAG_INTERNAL_BADGUY = 0x08000000, // a separate flag is needed for the internal ones because SFLAG_BADGUY has additional semantics.
SFLAG_KILLCOUNT = 0x10000000,
SFLAG_NOCANSEECHECK = 0x20000000,
SFLAG_HITRADIUSCHECK = 0x40000000,
};
enum

View file

@ -224,6 +224,25 @@ void initactorflags_d()
GREENSLIME + 7,
});
setflag(SFLAG_HITRADIUSCHECK, {
PODFEM1 ,
FEM1,
FEM2,
FEM3,
FEM4,
FEM5,
FEM6,
FEM7,
FEM8,
FEM9,
FEM10,
STATUE,
STATUEFLASH,
SPACEMARINE,
QUEBALL,
STRIPEBALL
});
gs.actorinfo[ORGANTIC].aimoffset = 32 << 8;
gs.actorinfo[ROTATEGUN].aimoffset = 32 << 8;

View file

@ -198,6 +198,14 @@ void initactorflags_r()
DOLPHIN2,
TOUGHGAL });
setflag(SFLAG_HITRADIUSCHECK, {
STATUEFLASH,
BOWLINGPIN,
QUEBALL,
STRIPEBALL
});
gs.actorinfo[RPG2].flags |= SFLAG_FORCEAUTOAIM;
gs.weaponsandammosprites[0] = RPGSPRITE;