From 5d4fd1d3b71e3e336add4709c27fc816d6819a46 Mon Sep 17 00:00:00 2001 From: Aleos Date: Tue, 19 May 2020 17:19:34 -0400 Subject: [PATCH] Resolves Autospell displaying errors to console (#4921) * Fixes #4883 * Fixes Autospell displaying invalid skill errors when clicking Ok or Cancel. Thanks to @admkakaroto! --- src/map/skill.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/map/skill.cpp b/src/map/skill.cpp index 645a951ec3..5489bd8eaa 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -17636,15 +17636,15 @@ int skill_autospell(struct map_session_data *sd, uint16 skill_id) { nullpo_ret(sd); - if (SKILL_CHK_GUILD(skill_id)) + if (skill_id == 0 || skill_get_index_(skill_id, true, __FUNCTION__, __FILE__, __LINE__) == 0 || SKILL_CHK_GUILD(skill_id)) return 0; uint16 lv = pc_checkskill(sd, skill_id), skill_lv = sd->menuskill_val; - - if(!skill_lv || !lv) return 0; // Player must learn the skill before doing auto-spell [Lance] - uint16 maxlv = 1; + if (skill_lv == 0 || lv == 0) + return 0; // Player must learn the skill before doing auto-spell [Lance] + #ifdef RENEWAL if ((skill_id == MG_COLDBOLT || skill_id == MG_FIREBOLT || skill_id == MG_LIGHTNINGBOLT) && sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_SAGE) maxlv = 10; //Soul Linker bonus. [Skotlex]