From 7b470d30ab2cc150d1420bc69374bb3b407f5f01 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Wed, 11 May 2016 19:04:01 +0200 Subject: [PATCH] Elemental.es/Computer.cpp changes according to @SLAwww's suggestions --- Sources/Entities/Elemental.es | 2 +- Sources/EntitiesMP/Elemental.es | 2 +- Sources/GameMP/Computer.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/Entities/Elemental.es b/Sources/Entities/Elemental.es index c5b4194..16efed6 100644 --- a/Sources/Entities/Elemental.es +++ b/Sources/Entities/Elemental.es @@ -1324,7 +1324,7 @@ procedures: autocall FallOnFloor() EReturn; } - if (m_EecChar==ELC_LARGE || (m_EecChar==ELC_BIG && m_EetType==ELT_LAVA)) + if ((m_EecChar==ELC_LARGE || m_EecChar==ELC_BIG) && m_EetType==ELT_LAVA) { PlaySound(m_soBackground, SOUND_LAVA_LAVABURN, SOF_3D|SOF_LOOP); } diff --git a/Sources/EntitiesMP/Elemental.es b/Sources/EntitiesMP/Elemental.es index 1c65808..2d155d8 100644 --- a/Sources/EntitiesMP/Elemental.es +++ b/Sources/EntitiesMP/Elemental.es @@ -1373,7 +1373,7 @@ procedures: autocall FallOnFloor() EReturn; } - if (m_EecChar==ELC_LARGE || (m_EecChar==ELC_BIG && m_EetType==ELT_LAVA)) + if ((m_EecChar==ELC_LARGE || m_EecChar==ELC_BIG) && m_EetType==ELT_LAVA) { PlaySound(m_soBackground, SOUND_LAVA_LAVABURN, SOF_3D|SOF_LOOP); } diff --git a/Sources/GameMP/Computer.cpp b/Sources/GameMP/Computer.cpp index 60bf3cc..8a899d7 100644 --- a/Sources/GameMP/Computer.cpp +++ b/Sources/GameMP/Computer.cpp @@ -177,7 +177,7 @@ static PIXaabbox2D GetMsgSliderSpace(void) static PIXaabbox2D GetTextSliderBox(void) { - if (_iActiveMessage>=_acmMessages.Count()) { + if ((_iActiveMessage >= _acmMessages.Count()) || (_iActiveMessage < 0)) { return PIXaabbox2D(); } INDEX ctTextLines = _acmMessages[_iActiveMessage].cm_ctFormattedLines; @@ -246,7 +246,7 @@ void LastUnreadMessage(void) // go to next/previous message void PrevMessage(void) { - if (_iActiveMessage >= _acmMessages.Count()) { + if ((_iActiveMessage >= _acmMessages.Count()) || (_iActiveMessage < 0)) { return; } _iActiveMessage--; @@ -258,7 +258,7 @@ void PrevMessage(void) void NextMessage(void) { - if (_iActiveMessage >= _acmMessages.Count()) { + if ((_iActiveMessage >= _acmMessages.Count()) || (_iActiveMessage < 0)) { return; } _iActiveMessage++; @@ -305,7 +305,7 @@ void MessageTextUp(INDEX ctLines) void MessageTextDn(INDEX ctLines) { // if no message do nothing - if (_iActiveMessage >= _acmMessages.Count()) { + if ((_iActiveMessage >= _acmMessages.Count()) || (_iActiveMessage < 0)) { return; } // find text lines count @@ -336,7 +336,7 @@ void MessageTextUpDn(INDEX ctLines) // mark current message as read void MarkCurrentRead(void) { - if (_iActiveMessage>=_acmMessages.Count()) { + if ((_iActiveMessage >= _acmMessages.Count()) || (_iActiveMessage < 0)) { return; } // if running in background