Codechange: explicitly initialise Subsidy member variables

This commit is contained in:
Rubidium
2025-02-18 20:14:25 +01:00
committed by rubidium42
parent be01c2cd2a
commit ce2ae07233
2 changed files with 9 additions and 13 deletions

View File

@@ -201,12 +201,7 @@ static bool CheckSubsidyDistance(Source src, Source dst)
*/
void CreateSubsidy(CargoType cargo_type, Source src, Source dst)
{
Subsidy *s = new Subsidy();
s->cargo_type = cargo_type;
s->src = src;
s->dst = dst;
s->remaining = SUBSIDY_OFFER_MONTHS;
s->awarded = CompanyID::Invalid();
Subsidy *s = new Subsidy(cargo_type, src, dst, SUBSIDY_OFFER_MONTHS);
std::pair<NewsReference, NewsReference> references = SetupSubsidyDecodeParam(s, SubsidyDecodeParamType::NewsOffered);
AddNewsItem(STR_NEWS_SERVICE_SUBSIDY_OFFERED, NewsType::Subsidies, NewsStyle::Normal, {}, references.first, references.second);