mirror of https://github.com/OpenTTD/OpenTTD
(svn r23665) -Fix (r23664): revert, and apply other fix, which allows switching companies safely in SinglePlayer
parent
d6e88a7cab
commit
7702151a62
|
@ -80,8 +80,6 @@ CommandCost CmdCreateGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||||
default: return CMD_ERROR;
|
default: return CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (company != INVALID_OWNER && company != _local_company) return CommandCost();
|
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
Goal *g = new Goal();
|
Goal *g = new Goal();
|
||||||
g->type = type;
|
g->type = type;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "goal_base.h"
|
#include "goal_base.h"
|
||||||
#include "core/geometry_func.hpp"
|
#include "core/geometry_func.hpp"
|
||||||
|
#include "company_func.h"
|
||||||
|
|
||||||
#include "widgets/goal_widget.h"
|
#include "widgets/goal_widget.h"
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@ struct GoalListWindow : Window {
|
||||||
if (y < 0) return;
|
if (y < 0) return;
|
||||||
|
|
||||||
FOR_ALL_GOALS(s) {
|
FOR_ALL_GOALS(s) {
|
||||||
if (s->company != INVALID_COMPANY) {
|
if (s->company == _local_company) {
|
||||||
y--;
|
y--;
|
||||||
if (y == 0) {
|
if (y == 0) {
|
||||||
this->HandleClick(s);
|
this->HandleClick(s);
|
||||||
|
@ -119,7 +120,7 @@ struct GoalListWindow : Window {
|
||||||
FOR_ALL_GOALS(s) {
|
FOR_ALL_GOALS(s) {
|
||||||
if (s->company == INVALID_COMPANY) {
|
if (s->company == INVALID_COMPANY) {
|
||||||
num_global++;
|
num_global++;
|
||||||
} else {
|
} else if (s->company == _local_company) {
|
||||||
num_company++;
|
num_company++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -189,7 +190,7 @@ struct GoalListWindow : Window {
|
||||||
num = 0;
|
num = 0;
|
||||||
|
|
||||||
FOR_ALL_GOALS(s) {
|
FOR_ALL_GOALS(s) {
|
||||||
if (s->company != INVALID_COMPANY) {
|
if (s->company == _local_company) {
|
||||||
if (IsInsideMM(pos, 0, cap)) {
|
if (IsInsideMM(pos, 0, cap)) {
|
||||||
/* Display the goal */
|
/* Display the goal */
|
||||||
SetDParamStr(0, s->text);
|
SetDParamStr(0, s->text);
|
||||||
|
|
Loading…
Reference in New Issue