From 3298ca9eb749741ade89663193d1b76445ceb5de Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Wed, 11 May 2022 08:50:05 +0200 Subject: [PATCH] Added roulette window state tracking (#6936) Fixes #6931 Thanks to @mazvi, @aleos89 and Ziu --- src/map/clif.cpp | 4 +++- src/map/pc.hpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index d1228ff119..fe407f2794 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20499,6 +20499,8 @@ void clif_roulette_open( struct map_session_data* sd ){ p.SilverPoint = sd->roulette_point.silver; p.BronzePoint = sd->roulette_point.bronze; + sd->state.roulette_open = true; + clif_send( &p, sizeof( p ), &sd->bl, SELF ); } @@ -20566,7 +20568,7 @@ void clif_parse_roulette_close( int fd, struct map_session_data* sd ){ return; } - // What do we need this for? (other than state tracking), game client closes the window without our response. + sd->state.roulette_open = false; } /// Response to a item reward request diff --git a/src/map/pc.hpp b/src/map/pc.hpp index 3a06415c4f..f568615180 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -393,6 +393,7 @@ struct map_session_data { uint16 inventory_expansion_amount; t_itemid laphine_synthesis; t_itemid laphine_upgrade; + bool roulette_open; } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage; @@ -1065,7 +1066,8 @@ static bool pc_cant_act2( struct map_session_data* sd ){ || sd->state.trading || sd->state.storage_flag || sd->state.prevend || sd->state.refineui_open || sd->state.stylist_open || sd->state.inventory_expansion_confirmation || sd->npc_shopid || sd->state.barter_open || sd->state.barter_extended_open - || sd->state.laphine_synthesis || sd->state.laphine_upgrade; + || sd->state.laphine_synthesis || sd->state.laphine_upgrade + || sd->state.roulette_open; } // equals pc_cant_act2 and additionally checks for chat rooms and npcs static bool pc_cant_act( struct map_session_data* sd ){