summaryrefslogtreecommitdiff
path: root/economy.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-14 18:17:24 +0000
committertruelight <truelight@openttd.org>2004-12-14 18:17:24 +0000
commit967762e5ef56def110bc283a0f0b5023e4908aa7 (patch)
treede5a9a2e95463804609f0e7e6a89e761fcff4320 /economy.c
parent55f334751475a2e1826c51ac43d27445f5c8a8ac (diff)
downloadopenttd-967762e5ef56def110bc283a0f0b5023e4908aa7.tar.xz
(svn r1086) -Fix: [Network] [ 1084774 ] Fixed quick-share-sell bug
Diffstat (limited to 'economy.c')
-rw-r--r--economy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/economy.c b/economy.c
index a42d6fd27..78b88ba14 100644
--- a/economy.c
+++ b/economy.c
@@ -1514,6 +1514,10 @@ int32 CmdSellShareInCompany(int x, int y, uint32 flags, uint32 p1, uint32 p2)
SET_EXPENSES_TYPE(EXPENSES_OTHER);
p = DEREF_PLAYER(p1);
+ /* Those lines are here for network-protection (clients can be slow) */
+ if (GetAmountOwnedBy(p, _current_player) == 0)
+ return 0;
+
/* adjust it a little to make it less profitable to sell and buy */
cost = CalculateCompanyValue(p) >> 2;
cost = -(cost - (cost >> 7));