mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #9448 from ZehMatt/fix-9287
Fix marketing/money effect bugs
This commit is contained in:
commit
cc82975090
|
@ -36,6 +36,7 @@ enum
|
|||
|
||||
enum
|
||||
{
|
||||
CAMPAIGN_FIRST_WEEK_FLAG = (1 << 6),
|
||||
CAMPAIGN_ACTIVE_FLAG = (1 << 7)
|
||||
};
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
// This string specifies which version of network stream current build uses.
|
||||
// It is used for making sure only compatible builds get connected, even within
|
||||
// single OpenRCT2 version.
|
||||
#define NETWORK_STREAM_VERSION "43"
|
||||
#define NETWORK_STREAM_VERSION "44"
|
||||
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
|
||||
|
||||
static Peep* _pickup_peep = nullptr;
|
||||
|
|
|
@ -795,6 +795,8 @@ void S6Exporter::ExportMarketingCampaigns()
|
|||
for (const auto& campaign : gMarketingCampaigns)
|
||||
{
|
||||
_s6.campaign_weeks_left[campaign.Type] = campaign.WeeksLeft | CAMPAIGN_ACTIVE_FLAG;
|
||||
if ((campaign.Flags & MarketingCampaignFlags::FIRST_WEEK))
|
||||
_s6.campaign_weeks_left[campaign.Type] |= CAMPAIGN_FIRST_WEEK_FLAG;
|
||||
if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE)
|
||||
{
|
||||
_s6.campaign_ride_index[campaign.Type] = campaign.RideId;
|
||||
|
|
|
@ -1072,7 +1072,11 @@ public:
|
|||
{
|
||||
MarketingCampaign campaign{};
|
||||
campaign.Type = (uint8_t)i;
|
||||
campaign.WeeksLeft = _s6.campaign_weeks_left[i] & ~CAMPAIGN_ACTIVE_FLAG;
|
||||
campaign.WeeksLeft = _s6.campaign_weeks_left[i] & ~(CAMPAIGN_ACTIVE_FLAG | CAMPAIGN_FIRST_WEEK_FLAG);
|
||||
if ((_s6.campaign_weeks_left[i] & CAMPAIGN_FIRST_WEEK_FLAG) != 0)
|
||||
{
|
||||
campaign.Flags |= MarketingCampaignFlags::FIRST_WEEK;
|
||||
}
|
||||
if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE)
|
||||
{
|
||||
campaign.RideId = _s6.campaign_ride_index[i];
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue