diff options
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 9af3c9213..fc0769b57 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4543,12 +4543,19 @@ int pc_memo(struct map_session_data* sd, int pos) int pc_checkskill(struct map_session_data *sd,int skill_id) { if(sd == NULL) return 0; - if( skill_id>=GD_SKILLBASE){ + if( skill_id >= GD_SKILLBASE && skill_id < GD_MAX ) + { struct guild *g; + if( sd->status.guild_id>0 && (g=guild_search(sd->status.guild_id))!=NULL) return guild_checkskill(g,skill_id); return 0; } + else if( skill_id < 0 || skill_id >= ARRAYLENGTH(sd->status.skill) ) + { + ShowError("pc_checkskill: Invalid skill id %d (char_id=%d).\n", skill_id, sd->status.char_id); + return 0; + } if(sd->status.skill[skill_id].id == skill_id) return (sd->status.skill[skill_id].lv); |