Fix a bug

This commit is contained in:
Miloslav Číž 2020-01-02 00:35:53 +01:00
parent 03638e62ec
commit 50a1a74b7e

10
main.c
View File

@ -950,7 +950,7 @@ void SFG_setAndInitLevel(const SFG_Level *level)
monster = monster =
&(SFG_currentLevel.monsterRecords[SFG_currentLevel.monsterRecordCount]); &(SFG_currentLevel.monsterRecords[SFG_currentLevel.monsterRecordCount]);
monster->stateType = e->type | 0; monster->stateType = e->type | SFG_MONSTER_STATE_INACTIVE;
monster->health = SFG_GET_MONSTER_MAX_HEALTH(SFG_MONSTER_TYPE_TO_INDEX(e->type)); monster->health = SFG_GET_MONSTER_MAX_HEALTH(SFG_MONSTER_TYPE_TO_INDEX(e->type));
monster->coords[0] = e->coords[0] * 4 + 2; monster->coords[0] = e->coords[0] * 4 + 2;
@ -1971,18 +1971,18 @@ void SFG_gameStep()
{ {
SFG_MonsterRecord *m = &(SFG_currentLevel.monsterRecords[j]); SFG_MonsterRecord *m = &(SFG_currentLevel.monsterRecords[j]);
if (SFG_MR_TYPE(*m) != SFG_MONSTER_STATE_INACTIVE) if (SFG_MR_STATE(*m) != SFG_MONSTER_STATE_INACTIVE)
{ {
if ( if (
SFG_elementCollides( SFG_elementCollides(
p->position[0],
p->position[1],
p->position[2],
SFG_MONSTER_COORD_TO_RCL_UNITS(m->coords[0]), SFG_MONSTER_COORD_TO_RCL_UNITS(m->coords[0]),
SFG_MONSTER_COORD_TO_RCL_UNITS(m->coords[1]), SFG_MONSTER_COORD_TO_RCL_UNITS(m->coords[1]),
SFG_floorHeightAt( SFG_floorHeightAt(
SFG_MONSTER_COORD_TO_SQUARES(m->coords[0]), SFG_MONSTER_COORD_TO_SQUARES(m->coords[0]),
SFG_MONSTER_COORD_TO_SQUARES(m->coords[1])), SFG_MONSTER_COORD_TO_SQUARES(m->coords[1])),
p->position[0],
p->position[1],
p->position[2],
0, 0,
0) 0)
) )