Author: silene
Date: Sat May 30 10:56:47 2009
New Revision: 35938

URL: http://svn.gna.org/viewcvs/wesnoth?rev=35938&view=rev
Log:
Added a unit::set_name accessor for lightweight modification of unit names.

Modified:
    trunk/src/scripting/lua.cpp
    trunk/src/unit.hpp

Modified: trunk/src/scripting/lua.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/scripting/lua.cpp?rev=35938&r1=35937&r2=35938&view=diff
==============================================================================
--- trunk/src/scripting/lua.cpp (original)
+++ trunk/src/scripting/lua.cpp Sat May 30 10:56:47 2009
@@ -407,6 +407,7 @@
        modify_int_attrib("side", u.set_side(value));
        modify_int_attrib("moves", u.set_movement(value));
        modify_bool_attrib("resting", u.set_resting(value));
+       modify_tstring_attrib("name", u.set_name(value));
        modify_string_attrib("role", u.set_role(value));
        modify_string_attrib("facing", 
u.set_facing(map_location::parse_direction(value)));
        return 0;

Modified: trunk/src/unit.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.hpp?rev=35938&r1=35937&r2=35938&view=diff
==============================================================================
--- trunk/src/unit.hpp (original)
+++ trunk/src/unit.hpp Sat May 30 10:56:47 2009
@@ -97,6 +97,7 @@
 
        /** The unit name for display */
        const t_string &name() const { return name_; }
+       void set_name(const t_string &name) { name_ = name; }
        void rename(const std::string& name) {if (!unrenamable_) name_= name;}
 
        /** The unit's profile */


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to