News:

Please help making MegaGlest rock-stable by testing the pre-release snapshots.

Main Menu

Resources not refunded for canceled build (svn)

Started by daniel.santos, 15 January 2008, 06:21:19

daniel.santos

Current svn sources (revision 77 / alpha5).  When attempting to build a building where it wont build, for instance, resources are not refunded once the builder realizes it can't be put there.  Same is true for summoner when you cancel summoning.

Daniel

daniel.santos

#1
hmm, how do you attach a patch file here? :(

Index: trunk/source/glest_game/type_instances/unit.cpp
===================================================================
*** trunk/source/glest_game/type_instances/unit.cpp     (revision 77)
--- trunk/source/glest_game/type_instances/unit.cpp     (working copy)
***************
*** 437,442 ****
--- 437,445 ----
                return crFailUndefined;
        }

+       //undo so we get any refunds.
+       undoCommand(commands.back());
+
        //delete ans pop command
        delete commands.back();
        commands.pop_back();

martiño

#2
I've already fixed it.

daniel.santos

#3
hehe, you were fast :)