@@ -84,8 +84,7 @@ std::tuple<CommandCost, GoalID> CmdCreat
g->type = type;
g->dst = dest;
g->company = company;
g->text = stredup(text.c_str());
g->progress = nullptr;
g->text = text;
g->completed = false;
if (g->company == INVALID_COMPANY) {
@@ -143,8 +142,7 @@ CommandCost CmdSetGoalText(DoCommandFlag
if (flags & DC_EXEC) {
Goal *g = Goal::Get(goal);
free(g->text);
InvalidateWindowClassesData(WC_GOALS_LIST);
@@ -170,12 +168,7 @@ CommandCost CmdSetGoalProgress(DoCommand
free(g->progress);
if (text.empty()) {
} else {
g->progress = stredup(text.c_str());
}
g->progress = text;
@@ -255,7 +248,7 @@ CommandCost CmdGoalQuestion(DoCommandFla
if (company == INVALID_COMPANY && !Company::IsValidID(_local_company)) return CommandCost();
if (company != INVALID_COMPANY && company != _local_company) return CommandCost();
ShowGoalQuestion(uniqueid, type, button_mask, text.c_str());
ShowGoalQuestion(uniqueid, type, button_mask, text);
return CommandCost();