Pārlūkot izejas kodu

Added roulette window state tracking (#6936)

Fixes #6931

Thanks to @mazvi, @aleos89 and Ziu
Lemongrass3110 3 gadi atpakaļ
vecāks
revīzija
3298ca9eb7
2 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 3 1
      src/map/clif.cpp
  2. 3 1
      src/map/pc.hpp

+ 3 - 1
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

+ 3 - 1
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 ){