summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-18 10:48:15 +0000
committerrubidium <rubidium@openttd.org>2007-06-18 10:48:15 +0000
commit966e2738b9c97bb44276ec90ebfa4a202d67d715 (patch)
treee8ff8f3847b0d29507eeef3450ff752e9b318604 /src/economy.cpp
parentf6be61bb3481419a388d9dcdede16c2b5f77c4a2 (diff)
downloadopenttd-966e2738b9c97bb44276ec90ebfa4a202d67d715.tar.xz
(svn r10197) -Codechange: replace int32 with CommandCost where appropriate.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 47ee5c883..fd7d4babd 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -259,7 +259,7 @@ void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player)
for (i = 0; i < 4; i++) {
if (p->share_owners[i] == old_player) {
/* Sell his shares */
- int32 res = DoCommand(0, p->index, 0, DC_EXEC, CMD_SELL_SHARE_IN_COMPANY);
+ CommandCost res = DoCommand(0, p->index, 0, DC_EXEC, CMD_SELL_SHARE_IN_COMPANY);
/* Because we are in a DoCommand, we can't just execute an other one and
* expect the money to be removed. We need to do it ourself! */
SubtractMoneyFromPlayer(res);
@@ -273,7 +273,7 @@ void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player)
_current_player = p->share_owners[i];
if (_current_player != PLAYER_SPECTATOR) {
/* Sell the shares */
- int32 res = DoCommand(0, old_player, 0, DC_EXEC, CMD_SELL_SHARE_IN_COMPANY);
+ CommandCost res = DoCommand(0, old_player, 0, DC_EXEC, CMD_SELL_SHARE_IN_COMPANY);
/* Because we are in a DoCommand, we can't just execute an other one and
* expect the money to be removed. We need to do it ourself! */
SubtractMoneyFromPlayer(res);
@@ -1808,10 +1808,10 @@ extern int GetAmountOwnedBy(const Player *p, PlayerID owner);
* @param p1 player to buy the shares from
* @param p2 unused
*/
-int32 CmdBuyShareInCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdBuyShareInCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Player *p;
- int64 cost;
+ CommandCost cost;
/* Check if buying shares is allowed (protection against modified clients */
if (!IsValidPlayer((PlayerID)p1) || !_patches.allow_shares) return CMD_ERROR;
@@ -1854,7 +1854,7 @@ int32 CmdBuyShareInCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
* @param p1 player to sell the shares from
* @param p2 unused
*/
-int32 CmdSellShareInCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdSellShareInCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Player *p;
int64 cost;
@@ -1890,7 +1890,7 @@ int32 CmdSellShareInCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
* @param p1 player/company to buy up
* @param p2 unused
*/
-int32 CmdBuyCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdBuyCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Player *p;
PlayerID pid = (PlayerID)p1;