diff options
author | eathenabot <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-30 16:21:58 +0000 |
---|---|---|
committer | eathenabot <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-30 16:21:58 +0000 |
commit | 31570d071b6c4798847e2846f8cd9d1f5d9c38fc (patch) | |
tree | 1813e06a53817441a75ba12c685b104d3e291000 | |
parent | f17c3bc02c9e82147fb471132940e84d227ec4bc (diff) | |
download | hercules-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
-rw-r--r-- | src/common/mmo.h | 1 | ||||
-rw-r--r-- | src/map/pc.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h index 681c78520..a0634d025 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -563,6 +563,7 @@ enum { GD_RESTORE=10012, GD_EMERGENCYCALL=10013, GD_DEVELOPMENT=10014, + GD_MAX, }; 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); |