Przeglądaj źródła

Fixed some problems making gcc error out

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11223 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 17 lat temu
rodzic
commit
b65e451187
4 zmienionych plików z 26 dodań i 29 usunięć
  1. 6 5
      src/map/atcommand.c
  2. 0 1
      src/map/atcommand.h
  3. 19 22
      src/map/charcommand.c
  4. 1 1
      src/map/itemdb.h

+ 6 - 5
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;

+ 0 - 1
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);

+ 19 - 22
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;
 }

+ 1 - 1
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