From 3f2010dee651fd6fb06788154070be43986ebe15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Thu, 24 Dec 2020 21:31:09 +0100 Subject: [PATCH] Fix initialization --- game.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/game.h b/game.h index 92a8fdd..b1ea8be 100755 --- a/game.h +++ b/game.h @@ -2250,11 +2250,11 @@ void SFG_monsterPerformAI(SFG_MonsterRecord *monster) (attackType == SFG_MONSTER_ATTACK_MELEE) || (attackType == SFG_MONSTER_ATTACK_EXPLODE); - uint8_t monsterSquare[2] = - { - SFG_MONSTER_COORD_TO_SQUARES(monster->coords[0]), - SFG_MONSTER_COORD_TO_SQUARES(monster->coords[1]) - }; + uint8_t monsterSquare[2]; + /* because of cancerous C++ compilers that error on narrowing conversion in + { } we init this way: */ + monsterSquare[0] = SFG_MONSTER_COORD_TO_SQUARES(monster->coords[0]); + monsterSquare[1] = SFG_MONSTER_COORD_TO_SQUARES(monster->coords[1]); RCL_Unit currentHeight = SFG_floorCollisionHeightAt(monsterSquare[0],monsterSquare[1]);