(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.

This commit is contained in:
darkvater
2005-01-04 17:11:03 +00:00
parent 9d38a7afca
commit fc52b512aa
13 changed files with 39 additions and 7 deletions

View File

@@ -318,6 +318,8 @@ int32 CmdBuildCompanyHQ(int x, int y, uint32 flags, uint32 p1, uint32 p2)
int score;
int32 cost = 0;
SET_EXPENSES_TYPE(EXPENSES_PROPERTY);
if (CheckFlatLandBelow(tile, 2, 2, flags, 0, NULL) == CMD_ERROR)
return CMD_ERROR;
@@ -361,6 +363,8 @@ int32 CmdDestroyCompanyHQ(int x, int y, uint32 flags, uint32 p1, uint32 p2)
uint tile = TILE_FROM_XY(x,y);
Player *p;
SET_EXPENSES_TYPE(EXPENSES_PROPERTY);
if ((int)p1 != OWNER_WATER) // destruction was initiated by player
p = DEREF_PLAYER((byte)p1);
else { // find player that has HQ flooded, and reset their location_of_house