MegaGlest Forum

Archives (read only) => Vanilla Glest => Bug report => Topic started by: daniel.santos on 15 January 2008, 06:21:19

Title: Resources not refunded for canceled build (svn)
Post by: daniel.santos on 15 January 2008, 06:21:19
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
Title:
Post by: daniel.santos on 15 January 2008, 06:51:44
hmm, how do you attach a patch file here? :(

Code: [Select]
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();
Title:
Post by: martiƱo on 15 January 2008, 18:25:47
I've already fixed it.
Title:
Post by: daniel.santos on 16 January 2008, 00:54:35
hehe, you were fast :)