]> git.pond.sub.org Git - empserver/commit
Fix improve not to spend more money than available
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 3 Aug 2008 19:09:15 +0000 (15:09 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 9 Aug 2008 12:40:04 +0000 (08:40 -0400)
commitc20ac26ecc0b757dd6d13ebd74c8e8e4591d4d2e
tree85007a8547e1a255f99d0f54c56c11a1d7a7f2bf
parent4b696a5c3007aaac2a0cebf43d752511de59b9b0
Fix improve not to spend more money than available

improve() attempted not to spend the last dollar, but screwed up when
improving more than one sector.  This could bankrupt the player.

Replace the flawed code by the same simple method that is used
elsewhere: break the loop when there's not enough money left for the
current sector.
src/lib/commands/improve.c