diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-16 14:29:51 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-16 14:29:51 +0000 |
commit | ed347b86057e804d1644fc744e012cb43c7547dd (patch) | |
tree | 2ffd3dddf5a97262b9a6020874d95ebe0c7ae5f0 /src/map/charcommand.c | |
parent | fd6ff31e591191e8f6bbf2dee4bfe9001cc14395 (diff) | |
download | hercules-ed347b86057e804d1644fc744e012cb43c7547dd.tar.gz hercules-ed347b86057e804d1644fc744e012cb43c7547dd.tar.bz2 hercules-ed347b86057e804d1644fc744e012cb43c7547dd.tar.xz hercules-ed347b86057e804d1644fc744e012cb43c7547dd.zip |
Fixed some problems making gcc error out
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11223 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/charcommand.c')
-rw-r--r-- | src/map/charcommand.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/map/charcommand.c b/src/map/charcommand.c index fac0999bf..cfd3d59c8 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -1556,30 +1556,27 @@ int charcommand_lostskill(const int fd, struct map_session_data* sd, const char* return -1; } - if (skill_id >= 0 && skill_id < MAX_SKILL) { - if (skill_get_inf2(skill_id) & INF2_QUEST_SKILL) { - if ((pl_sd = map_nick2sd(player)) != NULL) { - if (pc_checkskill(pl_sd, skill_id) > 0) { - pl_sd->status.skill[skill_id].lv = 0; - pl_sd->status.skill[skill_id].flag = 0; - clif_skillinfoblock(pl_sd); - clif_displaymessage(fd, msg_txt(202)); // This player has forgotten the skill. - } else { - clif_displaymessage(fd, msg_txt(203)); // This player doesn't have this quest skill. - return -1; - } - } else { - clif_displaymessage(fd, msg_txt(3)); // Character not found. - return -1; - } - } else { - clif_displaymessage(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill. - return -1; - } - } else { - clif_displaymessage(fd, msg_txt(198)); // This skill number doesn't exist. + if (skill_id < 0 && skill_id >= MAX_SKILL) { + clif_displaymessage(fd, msg_txt(198)); // This skill number doesn't exist. + return -1; + } + if (!(skill_get_inf2(skill_id) & INF2_QUEST_SKILL)) { + clif_displaymessage(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill. return -1; } + if ((pl_sd = map_nick2sd(player)) == NULL) { + clif_displaymessage(fd, msg_txt(3)); // Character not found. + return -1; + } + if (pc_checkskill(pl_sd, skill_id) == 0) { + clif_displaymessage(fd, msg_txt(203)); // This player doesn't have this quest skill. + return -1; + } + + pl_sd->status.skill[skill_id].lv = 0; + pl_sd->status.skill[skill_id].flag = 0; + clif_skillinfoblock(pl_sd); + clif_displaymessage(fd, msg_txt(202)); // This player has forgotten the skill. return 0; } |