Переглянути джерело

- Fixed mysql ping setting being in minutes rather than hours.
- Removed npc_event_sub from npc.h and moved it to npc.c
- Cleaned up #warp to prevent spitting non-walkable tile warnings.
- Changed the meaning of msg_athena 2, it is now "invalid target cell, randomizing".


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6114 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 роки тому
батько
коміт
47adb68d91

+ 5 - 0
Changelog-Trunk.txt

@@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/04/16
+	* Fixed mysql ping setting being in minutes rather than hours. [Skotlex]
+	* Removed npc_event_sub from npc.h and moved it to npc.c [Skotlex]
+	* Cleaned up #warp to prevent spitting non-walkable tile warnings. [Skotlex]
+	* Changed the meaning of msg_athena 2, it is now "invalid target cell,
+	  randomizing". [Skotlex]
 	* Fixed wrong check of Deluge + Suiton which broke the water-requirement
 	  check for skills. [Skotlex]
 	* Cleared ud->target on remove-map, it should fix the phantom mob sprite

+ 1 - 1
conf-tmpl/msg_athena.conf

@@ -14,7 +14,7 @@
 
 0: Warped.
 1: Map not found.
-2: Coordinates out of range.
+2: Invalid coordinates, using random target cell.
 3: Character not found.
 4: Jump to %s
 5: Jump to %d %d

+ 2 - 2
src/char_sql/inter.c

@@ -374,8 +374,8 @@ int inter_init(const char *file)
 
 	if (connection_ping_interval) {
 		add_timer_func_list(inter_sql_ping, "inter_sql_ping");

-		add_timer_interval(gettick()+connection_ping_interval*60*1000,
-				inter_sql_ping, 0, 0, connection_ping_interval*60*1000);
+		add_timer_interval(gettick()+connection_ping_interval*60*60*1000,
+				inter_sql_ping, 0, 0, connection_ping_interval*60*60*1000);
 	}
 	return 0;
 }

+ 2 - 2
src/login_sql/login.c

@@ -407,8 +407,8 @@ int mmo_auth_sqldb_init(void) {
 
 	if (connection_ping_interval) {
 		add_timer_func_list(login_sql_ping, "login_sql_ping");

-		add_timer_interval(gettick()+connection_ping_interval*60*1000,
-				login_sql_ping, 0, 0, connection_ping_interval*60*1000);
+		add_timer_interval(gettick()+connection_ping_interval*60*60*1000,
+				login_sql_ping, 0, 0, connection_ping_interval*60*60*1000);
 	}
 	return 0;
 }

+ 4 - 2
src/map/atcommand.c

@@ -1248,9 +1248,10 @@ int atcommand_rura(
 		return -1;
 	}
 
-	if (map_getcell(m, x, y, CELL_CHKNOPASS))
+	if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS)) {
+		clif_displaymessage(fd, msg_table[2]);
 		x = y = 0; //Invalid cell, use random spot.
-
+	}
 	if (map[m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
 		clif_displaymessage(fd, msg_table[247]);
 		return -1;
@@ -6004,6 +6005,7 @@ int atcommand_nuke(
 
 	if ((pl_sd = map_nick2sd(atcmd_player_name)) != NULL) {
 		if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can kill only lower or same GM level
+			clif_skill_nodamage(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, -1, 1);
 			skill_castend_damage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, gettick(), 0);
 			clif_displaymessage(fd, msg_table[109]); // Player has been nuked!
 		} else {

+ 29 - 34
src/map/charcommand.c

@@ -1143,46 +1143,41 @@ int charcommand_warp(
 		return -1;
 	}
 
-	if (x <= 0)
-		x = rand() % 399 + 1;
-	if (y <= 0)
-		y = rand() % 399 + 1;
 	if (strstr(map_name, ".gat") == NULL && strstr(map_name, ".afm") == NULL && strlen(map_name) < MAP_NAME_LENGTH-4) // 16 - 4 (.gat)
 		strcat(map_name, ".gat");
 
-	if ((pl_sd = map_nick2sd(character)) != NULL) {
-		if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can rura+ only lower or same GM level
-			if (x > 0 && x < 400 && y > 0 && y < 400) {
-				m = map_mapname2mapid(map_name);
-				if (m >= 0 && map[m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
-					clif_displaymessage(fd, "You are not authorised to warp someone to this map.");
-					return -1;
-				}
-				if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
-					clif_displaymessage(fd, "You are not authorised to warp this player from its actual map.");
-					return -1;
-				}
-				if (pc_setpos(pl_sd, map[m].index, x, y, 3) == 0) {
-					clif_displaymessage(pl_sd->fd, msg_table[0]); // Warped.
-					clif_displaymessage(fd, msg_table[15]); // Player warped (message sends to player too).
-				} else {
-					clif_displaymessage(fd, msg_table[1]); // Map not found.
-					return -1;
-				}
-			} else {
-				clif_displaymessage(fd, msg_table[2]); // Coordinates out of range.
-				return -1;
-			}
-		} else {
-			clif_displaymessage(fd, msg_table[81]); // Your GM level don't authorise you to do this action on this player.
-			return -1;
-		}
-	} else {
+	if ((pl_sd = map_nick2sd(character)) == NULL) {
 		clif_displaymessage(fd, msg_table[3]); // Character not found.
 		return -1;
 	}
-
-	return 0;
+	if (pc_isGM(sd) < pc_isGM(pl_sd)) { // you can rura+ only lower or same GM level
+		clif_displaymessage(fd, msg_table[81]); // Your GM level don't authorise you to do this action on this player.
+		return -1;
+	}
+	m = map_mapname2mapid(map_name);
+	if (m < 0) {
+		clif_displaymessage(fd, msg_table[1]); // Map not found.
+		return -1;
+	}
+	if ((x || y) && map_getcell(m, x, y, CELL_CHKNOREACH)) {
+		clif_displaymessage(fd, msg_table[2]); // Coordinates out of range.
+		x = y = 0;
+	}
+	if (map[m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
+		clif_displaymessage(fd, "You are not authorised to warp someone to this map.");
+		return -1;
+	}
+	if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
+		clif_displaymessage(fd, "You are not authorised to warp this player from its actual map.");
+		return -1;
+	}
+	if (pc_setpos(pl_sd, map[m].index, x, y, 3) == 0) {
+		clif_displaymessage(pl_sd->fd, msg_table[0]); // Warped.
+		clif_displaymessage(fd, msg_table[15]); // Player warped (message sends to player too).
+		return 0;
+	}
+	//No error message specified...?
+	return -1;
 }
 
 /*==========================================

+ 2 - 2
src/map/map.c

@@ -3906,8 +3906,8 @@ int do_init(int argc, char *argv[]) {
 	
 	if (connection_ping_interval) {
 		add_timer_func_list(map_sql_ping, "map_sql_ping");
-		add_timer_interval(gettick()+connection_ping_interval*60*1000,
-				map_sql_ping, 0, 0, connection_ping_interval*60*1000);
+		add_timer_interval(gettick()+connection_ping_interval*60*60*1000,
+				map_sql_ping, 0, 0, connection_ping_interval*60*60*1000);
 	}
 #endif /* not TXT_ONLY */
 

+ 1 - 0
src/map/npc.c

@@ -302,6 +302,7 @@ int npc_event_export(char *lname,void *data,va_list ap)
 	return 0;
 }
 
+int npc_event_sub(struct map_session_data *, struct event_data *, const unsigned char *); //[Lance]
 /*==========================================
  * ‘S‚Ä‚ÌNPC‚ÌOn*ƒCƒxƒ“ƒgŽÀ�s
  *------------------------------------------

+ 0 - 1
src/map/npc.h

@@ -38,7 +38,6 @@ int npc_parse_mob(char *w1,char *w2,char *w3,char *w4);
 int npc_parse_mob2 (struct spawn_data*, int index); // [Wizputer]
 int npc_parse_warp(char *w1,char *w2,char *w3,char *w4);
 int npc_globalmessage(const char *name,char *mes);
-int npc_event_sub(struct map_session_data *, struct event_data *, const unsigned char *); //[Lance]
 
 int npc_enable(const char *name,int flag);
 int npc_changename(const char *name, const char *newname, short look); // [Lance]