Fix money effect having random position in multiplayer

This commit is contained in:
Matt committed 2019-06-19 03:18:58 +02:00
1 parent bbd93f93cc
commit 0a4fa68138
1 file changed
+9
+9
View File
@@ -12,6 +12,7 @@
#include "../interface/Viewport.h"
#include "../interface/Window.h"
#include "../localisation/Localisation.h"
#include "../network/network.h"
#include "Map.h"
#include "Sprite.h"
@@ -80,6 +81,14 @@ void rct_money_effect::Create(money32 value)
if (mapPosition.x == LOCATION_NULL)
{
// If game actions return no valid location of the action we can not use the screen
// coordinates as every client will have different ones.
if (network_get_mode() != NETWORK_MODE_NONE)
{
log_warning("Attempted to create money effect without a valid location in multiplayer");
return;
}
rct_window* mainWindow = window_get_main();
if (mainWindow == nullptr)
return;