diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 11 | ||||
-rw-r--r-- | src/map/atcommand.h | 1 | ||||
-rw-r--r-- | src/map/charcommand.c | 41 | ||||
-rw-r--r-- | src/map/itemdb.h | 2 |
4 files changed, 26 insertions, 29 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index da86e6073..428ff017d 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1237,7 +1237,7 @@ int atcommand_rura( const int fd, struct map_session_data* sd, const char* comma *------------------------------------------*/ int atcommand_where(const int fd, struct map_session_data* sd, const char* command, const char* message) { - struct map_session_data *pl_sd = NULL; + struct map_session_data* pl_sd; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof atcmd_player_name); @@ -1246,10 +1246,11 @@ int atcommand_where(const int fd, struct map_session_data* sd, const char* comma clif_displaymessage(fd, "Please, enter a player name (usage: @where <char name>)."); return -1; } - - if((pl_sd = map_nick2sd(atcmd_player_name)) == NULL - || strncmp(pl_sd->status.name,atcmd_player_name,NAME_LENGTH) != 0 - || battle_config.hide_GM_session && pc_isGM(sd) < pc_isGM(pl_sd) && !(battle_config.who_display_aid && pc_isGM(sd) >= battle_config.who_display_aid) + + pl_sd = map_nick2sd(atcmd_player_name); + if( pl_sd == NULL + || strncmp(pl_sd->status.name,atcmd_player_name,NAME_LENGTH) != 0 + || (battle_config.hide_GM_session && pc_isGM(sd) < pc_isGM(pl_sd) && !(battle_config.who_display_aid && pc_isGM(sd) >= battle_config.who_display_aid)) ) { clif_displaymessage(fd, msg_txt(3)); // Character not found. return -1; diff --git a/src/map/atcommand.h b/src/map/atcommand.h index 5e2ed5d63..6b94d9061 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -285,7 +285,6 @@ AtCommandType atcommand(struct map_session_data *sd, const int level, const char int get_atcommand_level(const AtCommandType type); char* msg_txt(int msg_number); // [Yor] -char* player_title_txt(int level); // [Lupus] void do_init_atcommand(void); void do_final_atcommand(void); 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; } diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 925ebf529..ebfbf5c87 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -4,7 +4,7 @@ #ifndef _ITEMDB_H_ #define _ITEMDB_H_ -#include "mmo.h" // ITEM_NAME_LENGTH +#include "../common/mmo.h" // ITEM_NAME_LENGTH #define MAX_RANDITEM 10000 |