diff options
author | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-01 21:27:57 +0000 |
---|---|---|
committer | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-01 21:27:57 +0000 |
commit | 983fcb851918b1ab40c182f6719b7e800fe0d643 (patch) | |
tree | 67c2f4d6a39fc9609fab53b487d952df7ef4c646 | |
parent | 463d4d445d4e8abe5753f508cc301c0da91ca46a (diff) | |
download | hercules-983fcb851918b1ab40c182f6719b7e800fe0d643.tar.gz hercules-983fcb851918b1ab40c182f6719b7e800fe0d643.tar.bz2 hercules-983fcb851918b1ab40c182f6719b7e800fe0d643.tar.xz hercules-983fcb851918b1ab40c182f6719b7e800fe0d643.zip |
Fixed skillname->ID DBMap storing skill integer value in void pointer.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15643 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | src/map/skill.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 1d3fc33d0..6a87829d2 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -114,7 +114,7 @@ int skill_name2id(const char* name) if( name == NULL ) return 0; - return (int)strdb_get(skilldb_name2id, name); + return *(int*)strdb_get(skilldb_name2id, name); } /// Maps skill ids to skill db offsets. @@ -15268,7 +15268,7 @@ void skill_cooldown_load(struct map_session_data * sd) static bool skill_parse_row_skilldb(char* split[], int columns, int current) {// id,range,hit,inf,element,nk,splash,max,list_num,castcancel,cast_defence_rate,inf2,maxcount,skill_type,blow_count,name,description int id = atoi(split[0]); - int i; + int i, *idp; if( (id >= GD_SKILLRANGEMIN && id <= GD_SKILLRANGEMAX) || (id >= HM_SKILLRANGEMIN && id <= HM_SKILLRANGEMAX) || (id >= MC_SKILLRANGEMIN && id <= MC_SKILLRANGEMAX) ) @@ -15308,7 +15308,9 @@ static bool skill_parse_row_skilldb(char* split[], int columns, int current) skill_split_atoi(split[14],skill_db[i].blewcount); safestrncpy(skill_db[i].name, trim(split[15]), sizeof(skill_db[i].name)); safestrncpy(skill_db[i].desc, trim(split[16]), sizeof(skill_db[i].desc)); - strdb_put(skilldb_name2id, skill_db[i].name, (void*)id); + CREATE(idp, int, 1); + *idp = id; + strdb_put(skilldb_name2id, skill_db[i].name, idp); return true; } @@ -15681,7 +15683,7 @@ void skill_reload (void) *------------------------------------------*/ int do_init_skill (void) { - skilldb_name2id = strdb_alloc(DB_OPT_DUP_KEY, 0); + skilldb_name2id = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, 0); skill_readdb(); group_db = idb_alloc(DB_OPT_BASE); |