From 70892bbbe1dfce18fe0cee586f70027da2884a13 Mon Sep 17 00:00:00 2001 From: pionere Date: Sat, 21 Sep 2024 10:44:48 +0200 Subject: [PATCH] simplify GetItemSpell --- Source/debug.cpp | 1 + Source/items.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/debug.cpp b/Source/debug.cpp index 1ace37292b4..dfea39f4344 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -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 diff --git a/Source/items.cpp b/Source/items.cpp index 6bdbd244919..fe6d283d401 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -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++; }