summaryrefslogtreecommitdiff
path: root/src/company_cmd.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-06-11 00:18:20 +0200
committerGitHub <noreply@github.com>2021-06-11 00:18:20 +0200
commitef25afd55ab868a4322d0c241b5c4898966ac919 (patch)
treed2741bdd0973cf374993fbf4d1a203aa9d79e519 /src/company_cmd.cpp
parentacb6348ba62337d7580397d8f858e4a0bd1b0cab (diff)
downloadopenttd-ef25afd55ab868a4322d0c241b5c4898966ac919.tar.xz
Fix #9348, 4d74e51: don't try to sell shares of spectators (#9349)
"new_owner" can be INVALID_OWNER, and as INVALID_OWNER == COMPANY_SPECTATORS, we could end up trying to sell shares of nobody.
Diffstat (limited to 'src/company_cmd.cpp')
-rw-r--r--src/company_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index e58d29b2b..1c79c4b8a 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -67,7 +67,7 @@ Company::Company(uint16 name_1, bool is_ai)
this->clear_limit = (uint32)_settings_game.construction.clear_frame_burst << 16;
this->tree_limit = (uint32)_settings_game.construction.tree_frame_burst << 16;
- for (uint j = 0; j < 4; j++) this->share_owners[j] = COMPANY_SPECTATOR;
+ for (uint j = 0; j < 4; j++) this->share_owners[j] = INVALID_OWNER;
InvalidateWindowData(WC_PERFORMANCE_DETAIL, 0, INVALID_COMPANY);
}