summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c6
-rw-r--r--src/map/charcommand.c63
-rw-r--r--src/map/map.c4
-rw-r--r--src/map/npc.c1
-rw-r--r--src/map/npc.h1
5 files changed, 36 insertions, 39 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 2501e633c..d32d0fa66 100644
--- a/src/map/atcommand.c
+++ b/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 {
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index 6c589473e..4f7d8eb01 100644
--- a/src/map/charcommand.c
+++ b/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;
}
/*==========================================
diff --git a/src/map/map.c b/src/map/map.c
index d749d26bf..94bc6a57c 100644
--- a/src/map/map.c
+++ b/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 */
diff --git a/src/map/npc.c b/src/map/npc.c
index 2d3428eec..a5014de51 100644
--- a/src/map/npc.c
+++ b/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]
/*==========================================
* 全てのNPCのOn*イベント実行
*------------------------------------------
diff --git a/src/map/npc.h b/src/map/npc.h
index 760a61aae..e05687969 100644
--- a/src/map/npc.h
+++ b/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]