From 504bd44abcfc6d712adf7b88947d804df1b78805 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Fri, 4 Dec 2020 19:29:09 +0100 Subject: [PATCH] Simplify ClearReadiedSpell Setting force_redraw twice has no negative side and saves us a bool check later. --- Source/spells.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Source/spells.cpp b/Source/spells.cpp index 0be87e222..cda06de13 100644 --- a/Source/spells.cpp +++ b/Source/spells.cpp @@ -139,21 +139,15 @@ bool IsReadiedSpellValid(const PlayerStruct &player) */ void ClearReadiedSpell(PlayerStruct &player) { - bool needsRedraw = false; - int &readiedSpell = player._pRSpell; if (readiedSpell != SPL_INVALID) { readiedSpell = SPL_INVALID; - needsRedraw = true; + force_redraw = 255; } char &readiedSpellType = player._pRSplType; if (readiedSpellType != RSPLTYPE_INVALID) { readiedSpellType = RSPLTYPE_INVALID; - needsRedraw = true; - } - - if (needsRedraw) { force_redraw = 255; } }