From 8212088c03c0a0af451f734391699e5dab8d8608 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 20 Oct 2007 14:51:09 +0000 Subject: (svn r11312) -Codechange: implement a overflow safe integer and use that for money and don't misuses CommandCost to have a overflow safe integer. Based on a patch by Noldo. --- src/ai/trolly/trolly.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ai/trolly/trolly.cpp') diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp index 2c30b682e..a65371368 100644 --- a/src/ai/trolly/trolly.cpp +++ b/src/ai/trolly/trolly.cpp @@ -954,7 +954,7 @@ static void AiNew_State_VerifyRoute(Player *p) // Check if we have enough money for it! if (p->ainew.new_cost > p->player_money - AI_MINIMUM_MONEY) { // Too bad.. - DEBUG(ai, 1, "Insufficient funds to build route (%d)", p->ainew.new_cost); + DEBUG(ai, 1, "Insufficient funds to build route (%" OTTD_PRINTF64 "d)", (int64)p->ainew.new_cost); p->ainew.state = AI_STATE_NOTHING; return; } @@ -1086,7 +1086,7 @@ static void AiNew_State_BuildPath(Player *p) } } - DEBUG(ai, 1, "Finished building path, cost: %d", p->ainew.new_cost); + DEBUG(ai, 1, "Finished building path, cost: %" OTTD_PRINTF64 "d", (int64)p->ainew.new_cost); p->ainew.state = AI_STATE_BUILD_DEPOT; } } -- cgit v1.2.3-70-g09d2