mail[Wesnoth-commits] r44562 - in /trunk: data/lua/wml-tags.lua src/game_events.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on July 22, 2010 - 22:06:
Author: silene
Date: Thu Jul 22 22:06:16 2010
New Revision: 44562

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44562&view=rev
Log:
Moved implementation of [store_turns] to Lua.

Modified:
    trunk/data/lua/wml-tags.lua
    trunk/src/game_events.cpp

Modified: trunk/data/lua/wml-tags.lua
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/lua/wml-tags.lua?rev=44562&r1=44561&r2=44562&view=diff
==============================================================================
--- trunk/data/lua/wml-tags.lua (original)
+++ trunk/data/lua/wml-tags.lua Thu Jul 22 22:06:16 2010
@@ -374,3 +374,8 @@
                wesnoth.put_unit(ucfg)
        end
 end
+
+function wml_actions.store_turns(cfg)
+       local var = cfg.variable or "turns"
+       wesnoth.set_variable(var, wesnoth.game_config.last_turn)
+end

Modified: trunk/src/game_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=44562&r1=44561&r2=44562&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Thu Jul 22 22:06:16 2010
@@ -983,16 +983,6 @@
        }
 }
 
-WML_HANDLER_FUNCTION(store_turns, /*event_info*/, cfg)
-{
-       std::string var_name = cfg["variable"];
-       if(var_name.empty()) {
-               var_name = "turns";
-       }
-       int turns = resources::tod_manager->number_of_turns();
-       resources::state_of_game->get_variable(var_name) = turns;
-}
-
 namespace {
 
 std::auto_ptr<unit> create_fake_unit(const vconfig& cfg)




Related Messages


Powered by MHonArc, Updated Thu Jul 22 22:40:15 2010