Don't hurt dead monsters

This commit is contained in:
Miloslav Číž 2020-09-22 18:35:57 +02:00
parent 3e23f04a10
commit 597242b353
2 changed files with 9 additions and 3 deletions

10
game.h
View File

@ -1959,7 +1959,10 @@ void SFG_createExplosion(RCL_Unit x, RCL_Unit y, RCL_Unit z)
{ {
SFG_MonsterRecord *monster = &(SFG_currentLevel.monsterRecords[i]); SFG_MonsterRecord *monster = &(SFG_currentLevel.monsterRecords[i]);
if (SFG_MR_STATE(*monster) == SFG_MONSTER_STATE_INACTIVE) uint16_t state = SFG_MR_STATE(*monster);
if ((state == SFG_MONSTER_STATE_INACTIVE) ||
(state == SFG_MONSTER_STATE_DEAD))
continue; continue;
RCL_Unit monsterHeight = RCL_Unit monsterHeight =
@ -3029,7 +3032,10 @@ void SFG_gameStepPlaying()
{ {
SFG_MonsterRecord *m = &(SFG_currentLevel.monsterRecords[i]); SFG_MonsterRecord *m = &(SFG_currentLevel.monsterRecords[i]);
if (SFG_MR_STATE(*m) == SFG_MONSTER_STATE_INACTIVE) uint8_t state = SFG_MR_STATE(*m);
if ((state == SFG_MONSTER_STATE_INACTIVE) ||
(state == SFG_MONSTER_STATE_DEAD))
continue; continue;
RCL_Unit pX, pY, pZ; RCL_Unit pX, pY, pZ;

View File

@ -31,7 +31,7 @@
#define SFG_IMMORTAL 1 #define SFG_IMMORTAL 1
#define SFG_UNLOCK_DOOR 1 #define SFG_UNLOCK_DOOR 1
#define SFG_REVEAL_MAP 1 #define SFG_REVEAL_MAP 1
// #define SFG_INFINITE_AMMO 1 #define SFG_INFINITE_AMMO 1
#define MUSIC_VOLUME 4 #define MUSIC_VOLUME 4