diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 3f4ea8bc2..e04941336 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -203,7 +203,7 @@ int clif_setip(const char* ip) return 0; } - strncpy(map_ip_str, ip, sizeof(map_ip_str)); + safestrncpy(map_ip_str, ip, sizeof(map_ip_str)); ShowInfo("Map Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%s"CL_RESET"'.\n", ip, ip2str(map_ip, ip_str)); return 1; } @@ -9358,6 +9358,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) } map_iwall_get(sd); // Updates Walls Info on this Map to Client + status_calc_pc(sd, false);/* some conditions are map-dependent so we must recalculate */ sd->state.changemap = false; } @@ -10141,7 +10142,7 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd) if (pc_isdead(sd)) break; - if (pc_cant_act(sd)) + if ( pc_cant_act2(sd) ) break; if (sd->sc.count && ( @@ -10180,7 +10181,7 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd) if (sd->npc_id != sd->npc_item_flag) return; } - else if (pc_istrading(sd)) + else if ( pc_istrading(sd) || sd->chatID ) return; //Whether the item is used or not is irrelevant, the char ain't idle. [Skotlex] @@ -10213,7 +10214,7 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd) return; } else if (sd->state.storage_flag || sd->sc.opt1) ; //You can equip/unequip stuff while storage is open/under status changes - else if (pc_cant_act(sd)) + else if ( pc_cant_act2(sd) ) return; if(!sd->status.inventory[index].identify) { @@ -10250,7 +10251,7 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd) if (sd->state.storage_flag || sd->sc.opt1) ; //You can equip/unequip stuff while storage is open/under status changes - else if (pc_cant_act(sd)) + else if ( pc_cant_act2(sd) ) return; index = RFIFOW(fd,2)-2; @@ -10272,7 +10273,7 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd) return; } - if (pc_cant_act(sd)) + if ( pc_cant_act2(sd) ) return; bl = map_id2bl(RFIFOL(fd,2)); @@ -11111,11 +11112,16 @@ void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd) int npc_id = RFIFOL(fd,2); uint8 select = RFIFOB(fd,6); - if( (select > sd->npc_menu && select != 0xff) || select == 0 ) - { - TBL_NPC* nd = map_id2nd(npc_id); - ShowWarning("Invalid menu selection on npc %d:'%s' - got %d, valid range is [%d..%d] (player AID:%d, CID:%d, name:'%s')!\n", npc_id, (nd)?nd->name:"invalid npc id", select, 1, sd->npc_menu, sd->bl.id, sd->status.char_id, sd->status.name); - clif_GM_kick(NULL,sd); + if( (select > sd->npc_menu && select != 0xff) || select == 0 ) { +#if SECURE_NPCTIMEOUT + if( sd->npc_idle_timer != INVALID_TIMER ) { +#endif + TBL_NPC* nd = map_id2nd(npc_id); + ShowWarning("Invalid menu selection on npc %d:'%s' - got %d, valid range is [%d..%d] (player AID:%d, CID:%d, name:'%s')!\n", npc_id, (nd)?nd->name:"invalid npc id", select, 1, sd->npc_menu, sd->bl.id, sd->status.char_id, sd->status.name); + clif_GM_kick(NULL,sd); +#if SECURE_NPCTIMEOUT + } +#endif return; } |