Auto spell error log (fixes #1154)
* When using auto spell, it will no longer print error messages to the map-server when no valid skill was selected Note: This needs to be done because the client sends us random IDs if the user simply presses on "Ok" without selecting a skill, so it's technically not an error, but expected behavior that needs to be handled. Special thanks to @anacondaqq and @stealth62 for helping to reproduce the error.
This commit is contained in:
@@ -16595,12 +16595,18 @@ void skill_weaponrefine(struct map_session_data *sd, int idx)
|
||||
int skill_autospell(struct map_session_data *sd, uint16 skill_id)
|
||||
{
|
||||
uint16 skill_lv;
|
||||
uint16 idx = 0;
|
||||
int maxlv=1,lv;
|
||||
|
||||
nullpo_ret(sd);
|
||||
|
||||
skill_lv = sd->menuskill_val;
|
||||
lv=pc_checkskill(sd,skill_id);
|
||||
|
||||
if ((idx = skill_get_index2(skill_id)) == 0)
|
||||
return 0;
|
||||
if (SKILL_CHK_GUILD(skill_id))
|
||||
return 0;
|
||||
lv = (sd->status.skill[idx].id == skill_id) ? sd->status.skill[idx].lv : 0;
|
||||
|
||||
if(!skill_lv || !lv) return 0; // Player must learn the skill before doing auto-spell [Lance]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user