Remove unneeded condition

This commit is contained in:
Miloslav Číž 2020-11-19 15:50:05 +01:00
parent 2684689b45
commit 01eb383ff5

11
game.h
View File

@ -2197,7 +2197,7 @@ void SFG_monsterPerformAI(SFG_MonsterRecord *monster)
RCL_Unit currentHeight = RCL_Unit currentHeight =
SFG_floorCollisionHeightAt(monsterSquare[0],monsterSquare[1]); SFG_floorCollisionHeightAt(monsterSquare[0],monsterSquare[1]);
if ( // sometimes randomly attack if ( // ranged monsters: sometimes randomly attack
!notRanged && !notRanged &&
(SFG_random() < (SFG_random() <
SFG_GET_MONSTER_AGGRESSIVITY(SFG_MONSTER_TYPE_TO_INDEX(type))) SFG_GET_MONSTER_AGGRESSIVITY(SFG_MONSTER_TYPE_TO_INDEX(type)))
@ -2213,12 +2213,10 @@ void SFG_monsterPerformAI(SFG_MonsterRecord *monster)
SFG_GET_MONSTER_SPRITE_SIZE( SFG_GET_MONSTER_SPRITE_SIZE(
SFG_MONSTER_TYPE_TO_INDEX(type))))) SFG_MONSTER_TYPE_TO_INDEX(type)))))
{ {
// attack // ranged attack
state = SFG_MONSTER_STATE_ATTACKING; state = SFG_MONSTER_STATE_ATTACKING;
if (type != SFG_LEVEL_ELEMENT_MONSTER_WARRIOR)
{
RCL_Vector2D dir; RCL_Vector2D dir;
dir.x = SFG_player.camera.position.x - pos.x dir.x = SFG_player.camera.position.x - pos.x
@ -2280,8 +2278,7 @@ void SFG_monsterPerformAI(SFG_MonsterRecord *monster)
0, 0,
SFG_PROJECTILE_SPAWN_OFFSET SFG_PROJECTILE_SPAWN_OFFSET
); );
} } // if visible
}
else else
state = SFG_MONSTER_STATE_IDLE; state = SFG_MONSTER_STATE_IDLE;
} }
@ -2289,7 +2286,7 @@ void SFG_monsterPerformAI(SFG_MonsterRecord *monster)
{ {
if (notRanged) if (notRanged)
{ {
// non-ranged monsters walk towards player // non-ranged monsters: walk towards player
RCL_Unit pX, pY, pZ; RCL_Unit pX, pY, pZ;
SFG_getMonsterWorldPosition(monster,&pX,&pY,&pZ); SFG_getMonsterWorldPosition(monster,&pX,&pY,&pZ);