Fixed secure timeout triggering npc_scriptcont debug messages (#5239)
This commit is contained in:
parent
4a819c4f61
commit
2e88b27b9b
@ -12857,16 +12857,15 @@ void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd){
|
|||||||
int npc_id = RFIFOL(fd,info->pos[0]);
|
int npc_id = RFIFOL(fd,info->pos[0]);
|
||||||
uint8 select = RFIFOB(fd,info->pos[1]);
|
uint8 select = RFIFOB(fd,info->pos[1]);
|
||||||
|
|
||||||
if( (select > sd->npc_menu && select != 0xff) || select == 0 ) {
|
|
||||||
#ifdef SECURE_NPCTIMEOUT
|
#ifdef SECURE_NPCTIMEOUT
|
||||||
if( sd->npc_idle_timer != INVALID_TIMER ) {
|
if( sd->npc_idle_timer == INVALID_TIMER && !sd->state.ignoretimeout )
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if( (select > sd->npc_menu && select != 0xff) || select == 0 ) {
|
||||||
TBL_NPC* nd = map_id2nd(npc_id);
|
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);
|
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);
|
clif_GM_kick(NULL,sd);
|
||||||
#ifdef SECURE_NPCTIMEOUT
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1462,6 +1462,11 @@ bool npc_scriptcont(struct map_session_data* sd, int id, bool closing){
|
|||||||
|
|
||||||
nullpo_retr(true, sd);
|
nullpo_retr(true, sd);
|
||||||
|
|
||||||
|
#ifdef SECURE_NPCTIMEOUT
|
||||||
|
if( sd->npc_idle_timer == INVALID_TIMER && !sd->state.ignoretimeout )
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
if( id != sd->npc_id ){
|
if( id != sd->npc_id ){
|
||||||
TBL_NPC* nd_sd = (TBL_NPC*)map_id2bl(sd->npc_id);
|
TBL_NPC* nd_sd = (TBL_NPC*)map_id2bl(sd->npc_id);
|
||||||
TBL_NPC* nd = BL_CAST(BL_NPC, target);
|
TBL_NPC* nd = BL_CAST(BL_NPC, target);
|
||||||
|
@ -4369,7 +4369,7 @@ void script_attach_state(struct script_state* st){
|
|||||||
sd->npc_item_flag = st->npc_item_flag; // load default.
|
sd->npc_item_flag = st->npc_item_flag; // load default.
|
||||||
sd->state.disable_atcommand_on_npc = battle_config.atcommand_disable_npc && (!pc_has_permission(sd, PC_PERM_ENABLE_COMMAND));
|
sd->state.disable_atcommand_on_npc = battle_config.atcommand_disable_npc && (!pc_has_permission(sd, PC_PERM_ENABLE_COMMAND));
|
||||||
#ifdef SECURE_NPCTIMEOUT
|
#ifdef SECURE_NPCTIMEOUT
|
||||||
if( sd->npc_idle_timer == INVALID_TIMER )
|
if( sd->npc_idle_timer == INVALID_TIMER && !sd->state.ignoretimeout )
|
||||||
sd->npc_idle_timer = add_timer(gettick() + (SECURE_NPCTIMEOUT_INTERVAL*1000),npc_secure_timeout_timer,sd->bl.id,0);
|
sd->npc_idle_timer = add_timer(gettick() + (SECURE_NPCTIMEOUT_INTERVAL*1000),npc_secure_timeout_timer,sd->bl.id,0);
|
||||||
sd->npc_idle_tick = gettick();
|
sd->npc_idle_tick = gettick();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user