- fixed return values of badguy() and bossguy() functions.

This commit is contained in:
Christoph Oelckers 2023-04-09 15:45:19 +02:00
parent 684fb5eb74
commit 3df7539eb9
2 changed files with 4 additions and 4 deletions

View file

@ -22,15 +22,15 @@ inline int player_struct::GetPlayerNum()
DDukeActor* spawn(DDukeActor* spawner, int type);
DDukeActor* spawn(DDukeActor* actj, PClassActor* pname);
// return type is int for scripting - the value must still be true or false!
inline int badguy(DDukeActor* pSprite)
{
return pSprite->flags1 & (SFLAG_BADGUY | SFLAG_INTERNAL_BADGUY);
return !!(pSprite->flags1 & (SFLAG_BADGUY | SFLAG_INTERNAL_BADGUY));
}
inline int bossguy(DDukeActor* pSprite)
{
return pSprite->flags1 & SFLAG_BOSS;
return !!(pSprite->flags1 & SFLAG_BOSS);
}
// old interface versions of already changed functions

View file

@ -166,7 +166,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
if ((proj->spr.picnum == DTILE_FREEZEBLAST || proj->GetOwner() != targ) && targ->spr.statnum != STAT_PROJECTILE)
{
if (badguy(targ) == 1)
if (badguy(targ))
{
if (isWorldTour() && targ->spr.picnum == DTILE_FIREFLY && targ->spr.scale.X < 0.75)
return;