summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-25 16:15:28 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-25 16:15:28 +0000
commit6c99413dac07e73d40d5d822592567f690857957 (patch)
tree1bc9500fc345ae76e851a8a6487a482a539e0b5d /src
parentbbb2671566dada63d7a34616f93e66b18d91ef44 (diff)
downloadhercules-6c99413dac07e73d40d5d822592567f690857957.tar.gz
hercules-6c99413dac07e73d40d5d822592567f690857957.tar.bz2
hercules-6c99413dac07e73d40d5d822592567f690857957.tar.xz
hercules-6c99413dac07e73d40d5d822592567f690857957.zip
- Fixed "skill_sp_override_grffile: yes" causing crashes when parsing Homuncuus/Guild skills.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9069 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/skill.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 685158283..8559581cb 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11466,7 +11466,13 @@ static int skill_read_skillspamount (void)
} else if (new_flag && sscanf(p,"%[^#]#",buf2) == 1) {
for (idx=0; skill_names[idx].id != 0; idx++) {
if (strstr(buf2, skill_names[idx].name) != NULL) {
- skill = &skill_db[ skill_names[idx].id ];
+ //Apply Guild/Homunc adjustment.
+ sp = skill_names[idx].id;
+ if (sp >= GD_SKILLBASE) sp = GD_SKILLRANGEMIN + sp - GD_SKILLBASE;
+ if (sp >= HM_SKILLBASE) sp = HM_SKILLRANGEMIN + sp - HM_SKILLBASE;
+ if (sp < 1 || sp >= MAX_SKILL_DB)
+ continue;
+ skill = &skill_db[sp];
new_flag = 0;
break;
}