1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-21 11:22:45 +01:00

Codechange: explicitly initialise Goal member variables

This commit is contained in:
Rubidium
2025-02-18 16:53:43 +01:00
committed by rubidium42
parent 8682f39966
commit 0a285e1a86
2 changed files with 10 additions and 14 deletions

View File

@@ -85,12 +85,7 @@ std::tuple<CommandCost, GoalID> CmdCreateGoal(DoCommandFlags flags, CompanyID co
if (!Goal::IsValidGoalDestination(company, type, dest)) return { CMD_ERROR, GoalID::Invalid() };
if (flags.Test(DoCommandFlag::Execute)) {
Goal *g = new Goal();
g->type = type;
g->dst = dest;
g->company = company;
g->text = text;
g->completed = false;
Goal *g = new Goal(type, dest, company, text);
if (g->company == CompanyID::Invalid()) {
InvalidateWindowClassesData(WC_GOALS_LIST);