diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-05 14:45:13 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-05 14:45:13 +0000 |
commit | 2f254cd153ba353488bb80eb3b217592e32c54cc (patch) | |
tree | 2a36d2cbd1704d80a65dce0e61758b98e4252e05 /src/map/atcommand.c | |
parent | b37ff824d8160eb2cc8f45e435cfdb09cf7db077 (diff) | |
download | hercules-2f254cd153ba353488bb80eb3b217592e32c54cc.tar.gz hercules-2f254cd153ba353488bb80eb3b217592e32c54cc.tar.bz2 hercules-2f254cd153ba353488bb80eb3b217592e32c54cc.tar.xz hercules-2f254cd153ba353488bb80eb3b217592e32c54cc.zip |
Corrected the max. allowed skill name length, and optimized code that works with skill names according to latest changes.
Changed skill db loading code to work similarly to how itemdb/mobdb is loaded (generic file loader + specialized function to process rows).
* all skill db files are now checked for inconsistencies the same way.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11659 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 9b15ca0f6..0109cf290 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5620,8 +5620,7 @@ int atcommand_skillid(const int fd, struct map_session_data* sd, const char* com skillen = strlen(message); for (idx = 0; idx < MAX_SKILL_DB; idx++) { - if ((skill_db[idx].name != NULL && strnicmp(skill_db[idx].name, message, skillen) == 0) || - (skill_db[idx].desc != NULL && strnicmp(skill_db[idx].desc, message, skillen) == 0)) + if (strnicmp(skill_db[idx].name, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) { sprintf(atcmd_output, "skill %d: %s", idx, skill_db[idx].desc); clif_displaymessage(fd, atcmd_output); @@ -5750,12 +5749,9 @@ int atcommand_skilltree(const int fd, struct map_session_data* sd, const char* c ent = &skill_tree[c][skillidx]; for(j=0;j<5;j++) - if( ent->need[j].id && - pc_checkskill(sd,ent->need[j].id) < ent->need[j].lv) + if( ent->need[j].id && pc_checkskill(sd,ent->need[j].id) < ent->need[j].lv) { - char *desc = (skill_db[ ent->need[j].id ].desc) ? skill_db[ ent->need[j].id ].desc : "Unknown skill"; - sprintf(atcmd_output, "player requires level %d of skill %s", - ent->need[j].lv, desc); + sprintf(atcmd_output, "player requires level %d of skill %s", ent->need[j].lv, skill_db[ent->need[j].id].desc); clif_displaymessage(fd, atcmd_output); meets = 0; } |