Codechange: use std::variant instead of a custom version for news references

This commit is contained in:
Rubidium
2025-01-19 18:31:28 +01:00
committed by rubidium42
parent 2cb59b1856
commit 380e7b48ce
14 changed files with 175 additions and 137 deletions
+2 -2
View File
@@ -3416,7 +3416,7 @@ static CommandCost TownActionRoadRebuild(Town *t, DoCommandFlags flags)
AddNewsItem(
TimerGameEconomy::UsingWallclockUnits() ? STR_NEWS_ROAD_REBUILDING_MINUTES : STR_NEWS_ROAD_REBUILDING_MONTHS,
NewsType::General, NewsStyle::Normal, {}, NewsReferenceType::Town, t->index, NewsReferenceType::None, UINT32_MAX);
NewsType::General, NewsStyle::Normal, {}, t->index);
AI::BroadcastNewEvent(new ScriptEventRoadReconstruction(_current_company, t->index));
Game::NewEvent(new ScriptEventRoadReconstruction(_current_company, t->index));
}
@@ -3571,7 +3571,7 @@ static CommandCost TownActionBuyRights(Town *t, DoCommandFlags flags)
SetDParam(1, TimerGameEconomy::UsingWallclockUnits() ? STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION_MINUTES : STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION_MONTHS);
SetDParam(2, t->index);
SetDParamStr(3, cni->company_name);
AddNewsItem(STR_MESSAGE_NEWS_FORMAT, NewsType::General, NewsStyle::Company, {}, NewsReferenceType::Town, t->index, NewsReferenceType::None, UINT32_MAX, std::move(cni));
AddNewsItem(STR_MESSAGE_NEWS_FORMAT, NewsType::General, NewsStyle::Company, {}, t->index, {}, std::move(cni));
AI::BroadcastNewEvent(new ScriptEventExclusiveTransportRights(_current_company, t->index));
Game::NewEvent(new ScriptEventExclusiveTransportRights(_current_company, t->index));
}