1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Fix #8851: Show only game action errors to the issuer.

This commit is contained in:
Matt
2019-03-15 21:27:06 +01:00
parent 82f320eb24
commit 2090cbefae

View File

@@ -357,7 +357,19 @@ namespace GameActions
cb(action, result.get());
}
if (result->Error != GA_ERROR::OK && !(flags & GAME_COMMAND_FLAG_GHOST) && !(flags & GAME_COMMAND_FLAG_5))
// Only show errors when its not a ghost and not a preview and also top level action.
bool shouldShowError = !(flags & GAME_COMMAND_FLAG_GHOST) && !(flags & GAME_COMMAND_FLAG_5) && topLevel == true;
// In network mode the error should be only shown to the issuer of the action.
if (network_get_mode() != NETWORK_MODE_NONE)
{
if (action->GetPlayer() != network_get_current_player_id())
{
shouldShowError = false;
}
}
if (result->Error != GA_ERROR::OK && shouldShowError == true)
{
// Show the error box
std::copy(result->ErrorMessageArgs.begin(), result->ErrorMessageArgs.end(), gCommonFormatArgs);