summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authoreathenabot <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-30 16:21:58 +0000
committereathenabot <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-30 16:21:58 +0000
commit31570d071b6c4798847e2846f8cd9d1f5d9c38fc (patch)
tree1813e06a53817441a75ba12c685b104d3e291000 /src/map
parentf17c3bc02c9e82147fb471132940e84d227ec4bc (diff)
downloadhercules-31570d071b6c4798847e2846f8cd9d1f5d9c38fc.tar.gz
hercules-31570d071b6c4798847e2846f8cd9d1f5d9c38fc.tar.bz2
hercules-31570d071b6c4798847e2846f8cd9d1f5d9c38fc.tar.xz
hercules-31570d071b6c4798847e2846f8cd9d1f5d9c38fc.zip
* Merged changes up to eAthena 15069.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15525 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.c9
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);