From 8ebe2e02901617b06574b0902c9fc7ad04176d4e Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Mon, 14 Aug 2023 08:34:59 +0900 Subject: [PATCH] Fix -Wsign-compare warnings --- Source/cursor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/cursor.cpp b/Source/cursor.cpp index 4b7994800..d38aec70f 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -373,9 +373,9 @@ bool TrySelectPixelBased(Point tile) } } - int playerId = dPlayer[adjacentTile.x][adjacentTile.y]; - if (playerId != 0) { - playerId = std::abs(playerId) - 1; + const int8_t dPlayerValue = dPlayer[adjacentTile.x][adjacentTile.y]; + if (dPlayerValue != 0) { + const uint8_t playerId = std::abs(dPlayerValue) - 1; if (playerId != MyPlayerId) { const Player &player = Players[playerId]; const ClxSprite sprite = player.currentSprite(); @@ -832,7 +832,7 @@ void CheckCursMove() if (pcurstemp != -1 && TrySelectMonster(flipflag, currentTile, [](const Monster &monster) { if (!IsValidMonsterForSelection(monster)) return false; - if (monster.getId() != pcurstemp) + if (monster.getId() != static_cast(pcurstemp)) return false; return true; })) {