comparison src/main_gui.cpp @ 14230:95250f9a5035 draft

(svn r18781) -Codechange: pass the CommandCost to the callback instead of whether it succeeded or not. -Fix: AIs did update their last cost incorrectly in network games if the cost of the DC_EXEC phase differed from the ~DC_EXEC phase.
author rubidium <rubidium@openttd.org>
date Mon, 11 Jan 2010 18:46:09 +0000
parents 77bfe67f23bd
children a899d4e5ee1a
comparison
equal deleted inserted replaced
14229:3e2f1f02f08b 14230:95250f9a5035
41 #include "table/strings.h" 41 #include "table/strings.h"
42 42
43 static int _rename_id = 1; 43 static int _rename_id = 1;
44 static int _rename_what = -1; 44 static int _rename_what = -1;
45 45
46 void CcGiveMoney(bool success, TileIndex tile, uint32 p1, uint32 p2) 46 void CcGiveMoney(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
47 { 47 {
48 #ifdef ENABLE_NETWORK 48 #ifdef ENABLE_NETWORK
49 if (!success || !_settings_game.economy.give_money) return; 49 if (result.Failed() || !_settings_game.economy.give_money) return;
50 50
51 /* Inform the company of the action of one of it's clients (controllers). */ 51 /* Inform the company of the action of one of it's clients (controllers). */
52 char msg[64]; 52 char msg[64];
53 SetDParam(0, p2); 53 SetDParam(0, p2);
54 GetString(msg, STR_COMPANY_NAME, lastof(msg)); 54 GetString(msg, STR_COMPANY_NAME, lastof(msg));
110 _place_proc = placeproc; 110 _place_proc = placeproc;
111 return true; 111 return true;
112 } 112 }
113 113
114 114
115 void CcPlaySound10(bool success, TileIndex tile, uint32 p1, uint32 p2) 115 void CcPlaySound10(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
116 { 116 {
117 if (success) SndPlayTileFx(SND_12_EXPLOSION, tile); 117 if (result.Succeeded()) SndPlayTileFx(SND_12_EXPLOSION, tile);
118 } 118 }
119 119
120 #ifdef ENABLE_NETWORK 120 #ifdef ENABLE_NETWORK
121 void ShowNetworkGiveMoneyWindow(CompanyID company) 121 void ShowNetworkGiveMoneyWindow(CompanyID company)
122 { 122 {