(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.

This commit is contained in:
rubidium
2007-10-20 14:51:09 +00:00
parent 3a361422fa
commit eadd6765e1
12 changed files with 164 additions and 39 deletions

View File

@@ -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;
}
}