Skip to content

Commit

Permalink
simplify GetItemSpell
Browse files Browse the repository at this point in the history
  • Loading branch information
pionere committed Sep 21, 2024
1 parent 32463e7 commit 70892bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Source/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,7 @@ void ValidateData()
#endif

// spells
assert(spelldata[SPL_RESURRECT].sManaCost == 0); // required by GetItemSpell
assert(spelldata[SPL_TELEPORT].sSkillFlags & SDFLAG_TARGETED); // required by AddTeleport
#define OBJ_TARGETING_CURSOR(x) ((x) == CURSOR_NONE || (x) == CURSOR_DISARM)
assert(OBJ_TARGETING_CURSOR(spelldata[SPL_DISARM].scCurs)); // required by TryIconCurs
Expand Down
4 changes: 2 additions & 2 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1352,8 +1352,8 @@ static int GetItemSpell()

ns = 0;
for (bs = 0; bs < NUM_SPELLS; bs++) {
if (spelldata[bs].sManaCost != 0 // TODO: use sSkillFlags ?
&& (IsMultiGame || bs != SPL_RESURRECT)) {
if (spelldata[bs].sManaCost != 0) { // TODO: use sSkillFlags ?
// assert(!IsMultiGame || bs != SPL_RESURRECT);
ss[ns] = bs;
ns++;
}
Expand Down

0 comments on commit 70892bb

Please sign in to comment.