From 1437249b16dd853fbb177ca95dad8c30e99d2848 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Sat, 18 Feb 2017 19:18:59 +0100 Subject: [PATCH] Initialize variables --- src/decblupi.cpp | 2 +- src/decor.cpp | 32 ++++++++++++++++---------------- src/obstacle.cpp | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/decblupi.cpp b/src/decblupi.cpp index d1fecac..f3da9fb 100644 --- a/src/decblupi.cpp +++ b/src/decblupi.cpp @@ -2352,7 +2352,7 @@ void CDecor::BlupiStartStopRayon (Sint32 rank, POINT startCel, POINT endCel) bool CDecor::BlupiRotate (Sint32 rank) { - Sint32 aDirect, sDirect, ip, in, sens; + Sint32 aDirect, sDirect, ip, in, sens = 0; bool bOK; POINT pos; diff --git a/src/decor.cpp b/src/decor.cpp index efb01b8..8aa2874 100644 --- a/src/decor.cpp +++ b/src/decor.cpp @@ -2812,22 +2812,22 @@ void CDecor::CelHili (POINT pos, Sint32 action) m_celOutline1.x = (m_celHili.x / 2) * 2; m_celOutline1.y = (m_celHili.y / 2) * 2; - GetObject (m_celOutline1, channel, icon); - if (channel == CHOBJECT && - (icon == 14 || // métal ? - icon == 36 || // planches ? - icon == 44 || // pierres ? - icon == 60 || // tomates ? - icon == 64 || // oeufs ? - icon == 80 || // bouteille ? - icon == 82 || // fleurs ? - icon == 84 || // fleurs ? - icon == 95 || // fleurs ? - icon == 85 || // dynamite ? - icon == 92 || // poison ? - icon == 93 || // piège ? - icon == 123 || // fer ? - icon == 125)) // mine ? + if (GetObject (m_celOutline1, channel, icon) + && channel == CHOBJECT + && ( icon == 14 // métal ? + || icon == 36 // planches ? + || icon == 44 // pierres ? + || icon == 60 // tomates ? + || icon == 64 // oeufs ? + || icon == 80 // bouteille ? + || icon == 82 // fleurs ? + || icon == 84 // fleurs ? + || icon == 95 // fleurs ? + || icon == 85 // dynamite ? + || icon == 92 // poison ? + || icon == 93 // piège ? + || icon == 123 // fer ? + || icon == 125)) // mine ? { if (m_celHili.x % 2 == 0 || m_celHili.y % 2 == 0) diff --git a/src/obstacle.cpp b/src/obstacle.cpp index 83a0a68..a1fe31c 100644 --- a/src/obstacle.cpp +++ b/src/obstacle.cpp @@ -2388,7 +2388,7 @@ bool CDecor::SearchBestPass (Sint32 rank, Sint32 &action) { Blupi iBlupi; Sint32 i, j, direct; - POINT iCel, lCel, cel; + POINT iCel, lCel = { 0 }, cel; if (m_blupi[rank].perso == 0 || // blupi ? m_blupi[rank].perso == 7 || // électro ? @@ -2526,7 +2526,7 @@ bool CDecor::SearchOtherObject (Sint32 rank, POINT initCel, Sint32 action, POINT &foundCel, Sint32 &foundIcon) { Sint32 startx, starty, endx, endy; - Sint32 x, y, xx, yy; + Sint32 x, y, xx = 0, yy = 0; Sint32 dist, min = distMax; POINT cel; bool bOK;