From ab80a8fcc1338d70de974dcab09adb2d77ab76c2 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Fri, 24 Feb 2017 18:12:09 +0100 Subject: [PATCH] Replace if.. by switch --- src/decmove.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/decmove.cpp b/src/decmove.cpp index 2f96293..a07a8f2 100644 --- a/src/decmove.cpp +++ b/src/decmove.cpp @@ -1158,29 +1158,27 @@ void CDecor::MoveFire (Sint32 rank) if (m_decor[x / 2][y / 2].fire == DIMOBJY) { icon = m_decor[x / 2][y / 2].floorIcon; - if (icon == 20) // herbe foncée ? + switch (icon) { + case 20: // herbe foncée ? PutFloor (GetCel (x, y), CHFLOOR, 19); // herbe brulée - } - if (icon == 59) // pont ? - { + break; + case 59: // pont ? PutFloor (GetCel (x, y), CHFLOOR, 2); // rivage - } - if (icon == 61) // pont ? - { + break; + case 61: // pont ? PutFloor (GetCel (x, y), CHFLOOR, 4); // rivage - } - if (icon == 62) // pont ? - { + break; + case 62: // pont ? PutFloor (GetCel (x, y), CHFLOOR, 3); // rivage - } - if (icon == 64) // pont ? - { + break; + case 64: // pont ? PutFloor (GetCel (x, y), CHFLOOR, 5); // rivage - } - if (icon == 60 || icon == 63) // pont ? - { + break; + case 60: + case 63: // pont ? PutFloor (GetCel (x, y), CHFLOOR, 14); // eau + break; } }