mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
[Bug Fix] Fix nullptr spell in BCSpells::Load() (#2790)
* [Bug Fix] Fix nullptr spell in BCSpells::Load() # Notes - Fix possible `nullptr` where we didn't check if spell was valid before using it. * Cleanup.
This commit is contained in:
parent
bf39a0540c
commit
2b0c778ad1
@ -122,10 +122,20 @@ public:
|
||||
}
|
||||
|
||||
for (int spell_id = 2; spell_id < SPDAT_RECORDS; ++spell_id) {
|
||||
if (spells[spell_id].player_1[0] == '\0')
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
continue;
|
||||
if (spells[spell_id].target_type != ST_Target && spells[spell_id].cast_restriction != 0) // watch
|
||||
}
|
||||
|
||||
if (spells[spell_id].player_1[0] == '\0') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
spells[spell_id].target_type != ST_Target &&
|
||||
spells[spell_id].cast_restriction != 0
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto target_type = BCEnum::TT_None;
|
||||
switch (spells[spell_id].target_type) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user