Browse Source

Simplify ClearReadiedSpell

Setting force_redraw twice has no negative side and saves us a bool check later.
pull/940/head
Anders Jenbo 5 years ago
parent
commit
504bd44abc
  1. 8
      Source/spells.cpp

8
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;
}
}

Loading…
Cancel
Save