Fix a boss bug

This commit is contained in:
Miloslav Číž 2020-11-19 18:07:49 +01:00
parent e26511d390
commit 064dd28de3
2 changed files with 10 additions and 10 deletions

16
game.h
View File

@ -2849,6 +2849,14 @@ void SFG_updateLevel()
if (state == SFG_MONSTER_STATE_DYING) if (state == SFG_MONSTER_STATE_DYING)
{ {
monster->stateType =
(monster->stateType & 0xf0) | SFG_MONSTER_STATE_DEAD;
}
else if (monster->health == 0)
{
monster->stateType = (monster->stateType & SFG_MONSTER_MASK_TYPE) |
SFG_MONSTER_STATE_DYING;
if (SFG_MR_TYPE(*monster) == SFG_LEVEL_ELEMENT_MONSTER_ENDER) if (SFG_MR_TYPE(*monster) == SFG_LEVEL_ELEMENT_MONSTER_ENDER)
{ {
SFG_currentLevel.bossCount--; SFG_currentLevel.bossCount--;
@ -2862,14 +2870,6 @@ void SFG_updateLevel()
} }
} }
monster->stateType =
(monster->stateType & 0xf0) | SFG_MONSTER_STATE_DEAD;
}
else if (monster->health == 0)
{
monster->stateType = (monster->stateType & SFG_MONSTER_MASK_TYPE) |
SFG_MONSTER_STATE_DYING;
SFG_processEvent(SFG_EVENT_MONSTER_DIES,SFG_MR_TYPE(*monster)); SFG_processEvent(SFG_EVENT_MONSTER_DIES,SFG_MR_TYPE(*monster));
if (SFG_MR_TYPE(*monster) == SFG_LEVEL_ELEMENT_MONSTER_EXPLODER) if (SFG_MR_TYPE(*monster) == SFG_LEVEL_ELEMENT_MONSTER_EXPLODER)

View File

@ -26,11 +26,11 @@
// #define SFG_START_LEVEL 1 // #define SFG_START_LEVEL 1
// #define SFG_QUICK_WIN 1 // #define SFG_QUICK_WIN 1
#define SFG_IMMORTAL 1 // #define SFG_IMMORTAL 1
// #define SFG_ALL_LEVELS 1 // #define SFG_ALL_LEVELS 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 SFG_TIME_MULTIPLIER 512 // #define SFG_TIME_MULTIPLIER 512
// #define SFG_CPU_LOAD(percent) printf("CPU load: %d%\n",percent); // #define SFG_CPU_LOAD(percent) printf("CPU load: %d%\n",percent);
// #define GAME_LQ // #define GAME_LQ