[Bug Fix] Self Only Spells will no longer check target level or buff restrictions (#2931)

* [Bug Fix] Self Only Spells now work again (BuffSpellRestrictions)

* Moved variables under quick checks per review
This commit is contained in:
Paul Coene 2023-02-14 19:47:32 -05:00 committed by GitHub
parent 8ed7ca977f
commit 18b62667f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3192,8 +3192,10 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2,
// 66+ Group Spells 62, Single Target 61
bool Mob::CheckSpellLevelRestriction(Mob *caster, uint16 spell_id)
{
bool check_for_restrictions = false;
bool can_cast = true;
if (spells[spell_id].target_type == ST_Self) {
LogSpells("[CheckSpellLevelRestriction] Self Only spell - no restrictions");
return true;
}
if (!caster) {
LogSpells("[CheckSpellLevelRestriction] No caster");
@ -3205,6 +3207,9 @@ bool Mob::CheckSpellLevelRestriction(Mob *caster, uint16 spell_id)
return true;
}
bool check_for_restrictions = false;
bool can_cast = true;
// NON GM clients might be restricted by rule setting
if (caster->IsClient()) {
if (IsClient()) { // Only restrict client on client for this rule