Looks ok :)

Florian Köberle a écrit :
> ---
>  lib/wormux/include/WORMUX_action.h |    1 -
>  src/game/game_blitz.cpp            |    3 +--
>  src/game/game_classic.cpp          |    3 +--
>  src/include/action_handler.cpp     |    7 -------
>  src/map/wind.cpp                   |    8 ++++----
>  src/map/wind.h                     |    2 +-
>  6 files changed, 7 insertions(+), 17 deletions(-)
>
> diff --git a/lib/wormux/include/WORMUX_action.h 
> b/lib/wormux/include/WORMUX_action.h
> index b02c5e3..3c64807 100644
> --- a/lib/wormux/include/WORMUX_action.h
> +++ b/lib/wormux/include/WORMUX_action.h
> @@ -106,7 +106,6 @@ public:
>  
>      // ########################################################
>      ACTION_EXPLOSION,
> -    ACTION_WIND,
>      ACTION_NETWORK_PING,
>      ACTION_NETWORK_VERIFY_RANDOM_SYNC,
>      // ########################################################
> diff --git a/src/game/game_blitz.cpp b/src/game/game_blitz.cpp
> index 5f4ae28..4e3b6da 100644
> --- a/src/game/game_blitz.cpp
> +++ b/src/game/game_blitz.cpp
> @@ -161,8 +161,7 @@ void GameBlitz::__SetState_PLAYING()
>  {
>    MSG_DEBUG("game.statechange", "Playing" );
>  
> -  if (Network::GetInstance()->IsTurnMaster() || 
> Network::GetInstance()->IsLocal())
> -    Wind::GetRef().ChooseRandomVal();
> +  Wind::GetRef().ChooseRandomVal();
>  
>    SetCharacterChosen(false);
>  
> diff --git a/src/game/game_classic.cpp b/src/game/game_classic.cpp
> index 29fc9f9..d1009c9 100644
> --- a/src/game/game_classic.cpp
> +++ b/src/game/game_classic.cpp
> @@ -148,8 +148,7 @@ void GameClassic::__SetState_PLAYING()
>    Interface::GetInstance()->EnableDisplayTimer(true);
>    pause_seconde = Time::GetInstance()->Read();
>  
> -  if (Network::GetInstance()->IsTurnMaster() || 
> Network::GetInstance()->IsLocal())
> -    Wind::GetRef().ChooseRandomVal();
> +  Wind::GetRef().ChooseRandomVal();
>  
>    SetCharacterChosen(false);
>  
> diff --git a/src/include/action_handler.cpp b/src/include/action_handler.cpp
> index ac7c516..5e90b29 100644
> --- a/src/include/action_handler.cpp
> +++ b/src/include/action_handler.cpp
> @@ -41,7 +41,6 @@
>  #include "map/camera.h"
>  #include "map/map.h"
>  #include "map/maps_list.h"
> -#include "map/wind.h"
>  #include "menu/network_menu.h"
>  #include "network/randomsync.h"
>  #include "network/network.h"
> @@ -771,11 +770,6 @@ static void Action_Weapon_Supertux (Action *a)
>  
>  // ########################################################
>  
> -static void Action_Wind (Action *a)
> -{
> -  Wind::GetRef().SetVal (a->PopInt());
> -}
> -
>  static void Action_Network_RandomInit (Action *a)
>  {
>    MSG_DEBUG("random", "Initialization from network");
> @@ -1051,7 +1045,6 @@ void Action_Handler_Init()
>    ActionHandler::GetInstance()->Register (Action::ACTION_NETWORK_PING, 
> "NETWORK_ping", &Action_Network_Ping);
>  
>    ActionHandler::GetInstance()->Register (Action::ACTION_EXPLOSION, 
> "explosion", &Action_Explosion);
> -  ActionHandler::GetInstance()->Register (Action::ACTION_WIND, "wind", 
> &Action_Wind);
>    ActionHandler::GetInstance()->Register 
> (Action::ACTION_NETWORK_RANDOM_INIT, "NETWORK_random_init", 
> &Action_Network_RandomInit);
>    ActionHandler::GetInstance()->Register 
> (Action::ACTION_NETWORK_VERIFY_RANDOM_SYNC, "NETWORK_verify_random_sync", 
> &Action_Network_VerifyRandomSync);
>    ActionHandler::GetInstance()->Register 
> (Action::ACTION_INFO_CLIENT_DISCONNECT, "INFO_client_disconnect", 
> &Action_Info_ClientDisconnect);
> diff --git a/src/map/wind.cpp b/src/map/wind.cpp
> index 90fc650..79b25a5 100644
> --- a/src/map/wind.cpp
> +++ b/src/map/wind.cpp
> @@ -24,9 +24,9 @@
>  #include "game/config.h"
>  #include "game/time.h"
>  #include "graphic/sprite.h"
> -#include "include/action_handler.h"
>  #include "map/map.h"
>  #include "map/maps_list.h"
> +#include "network/randomsync.h"
>  #include <WORMUX_debug.h>
>  #include <WORMUX_random.h>
>  #include "tool/resource_manager.h"
> @@ -219,10 +219,10 @@ void Wind::Reset()
>    RandomizeParticlesPos();
>  }
>  
> -void Wind::ChooseRandomVal() const
> +void Wind::ChooseRandomVal()
>  {
> -  int val = RandomLocal().GetLong(-100, 100);
> -  ActionHandler::GetInstance()->NewAction (new Action(Action::ACTION_WIND, 
> val));
> +  MSG_DEBUG("random.get", "Wind::ChooseRandomVal()");
> +  SetVal(RandomSync().GetLong(-100, 100));
>  }
>  
>  void Wind::DrawParticles()
> diff --git a/src/map/wind.h b/src/map/wind.h
> index 740bbc2..63a8f0e 100644
> --- a/src/map/wind.h
> +++ b/src/map/wind.h
> @@ -69,7 +69,7 @@ private:
>  
>  public:
>    double GetStrength() const;
> -  void ChooseRandomVal() const;
> +  void ChooseRandomVal();
>  
>    void SetVal(long val);
>    void Refresh();
>   


_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à