Author Topic: Resources not refunded for canceled build (svn)  (Read 2451 times)

daniel.santos

  • Guest
Resources not refunded for canceled build (svn)
« 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
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

daniel.santos

  • Guest
(No subject)
« Reply #1 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();
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

martiño

  • Behemoth
  • *******
  • Posts: 1,095
    • View Profile
(No subject)
« Reply #2 on: 15 January 2008, 18:25:47 »
I've already fixed it.
« Last Edit: 1 January 1970, 00:00:00 by martiño »

daniel.santos

  • Guest
(No subject)
« Reply #3 on: 16 January 2008, 00:54:35 »
hehe, you were fast :)
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »