Skip to content

Commit

Permalink
validate spelldata.sMissile value in ValidateData
Browse files Browse the repository at this point in the history
- ensure either sType or SFLAG_RANGED-flag in sUseFlags is set
  • Loading branch information
pionere committed Sep 19, 2024
1 parent 0d31688 commit 7760926
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,8 @@ void ValidateData()
app_fatal("Targeted skill %s (%d) does not have scCurs.", sd.sNameText, i);
hasScrollSpell = true;
}
if (sd.sMissile != 0 && sd.sType == STYPE_NONE && !(sd.sUseFlags & SFLAG_RANGED)) // required by On_SKILLXY, On_SKILLMON, On_SKILLPLR
app_fatal("Skill %s (%d) supposed to use a missile, but neither sType nor the SFLAG_RANGED-flag is set.", sd.sNameText, i);
//if (!(sd.sUseFlags & SFLAG_DUNGEON) && sd.sType != STYPE_NONE && sd.sType != STYPE_MAGIC && i != SPL_NULL)
// app_fatal("GFX is not loaded in town for skill %s (%d).", sd.sNameText, i); // required by InitPlayerGFX
}
Expand Down

0 comments on commit 7760926

Please sign in to comment.