From 7702151a62e739b07805c738901bce9fef660fb2 Mon Sep 17 00:00:00 2001 From: truebrain Date: Fri, 23 Dec 2011 23:34:19 +0000 Subject: (svn r23665) -Fix (r23664): revert, and apply other fix, which allows switching companies safely in SinglePlayer --- src/goal_gui.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/goal_gui.cpp') diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index aeba8e576..26d5238df 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -20,6 +20,7 @@ #include "gui.h" #include "goal_base.h" #include "core/geometry_func.hpp" +#include "company_func.h" #include "widgets/goal_widget.h" @@ -63,7 +64,7 @@ struct GoalListWindow : Window { if (y < 0) return; FOR_ALL_GOALS(s) { - if (s->company != INVALID_COMPANY) { + if (s->company == _local_company) { y--; if (y == 0) { this->HandleClick(s); @@ -119,7 +120,7 @@ struct GoalListWindow : Window { FOR_ALL_GOALS(s) { if (s->company == INVALID_COMPANY) { num_global++; - } else { + } else if (s->company == _local_company) { num_company++; } } @@ -189,7 +190,7 @@ struct GoalListWindow : Window { num = 0; FOR_ALL_GOALS(s) { - if (s->company != INVALID_COMPANY) { + if (s->company == _local_company) { if (IsInsideMM(pos, 0, cap)) { /* Display the goal */ SetDParamStr(0, s->text); -- cgit v1.2.3-54-g00ecf