diff --git a/RELEASE_NOTES b/RELEASE_NOTES index f09db388843..0f90d026e57 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -64,7 +64,7 @@ A number of changes were made to the way Lua AI components are declared in the W [list=1] [*]If you used old-style Lua candidate actions (with execute= and evaluate= keys) together with an explicit [engine]name=lua tag, they will no longer work as written. In many cases, the fix will be simple - the code within [engine] frequently begins with a line similar to [c]local ai = ...[/c]. Simply removing this line will be sufficient to fix most such cases; if you accessed a "data" variable in the AI, see the Experimental AI definition (data/ai/ais/ai_generic_rush.cfg) for an example of how to fix it. [*]If you used old-style Lua candidate actions without an explicit engine tag, you may need to remove a line similar to [c]local ai = ...[/c] from some of your code. In general, anything of the form [c]ai = [/c] needs to be changed. -[*]If you used new-style (external) Lua candidate actions (with a location key), they will still work for the time being (provided that they use the exec_parms= and/or eval_parms= keys), but we recommend updating them nevertheless. The exec_parms= and eval_parms= keys should be combined into an [args] tag, and the argument list of your execution and evaluation functions should be changed from [c](ai, cfg, self)[/c] to [c](data, cfg)[/c]. The data parameter is the same as self.data was before; however, provided you do not have an explicit [engine] tag, self.data will continue to work. +[*]If you used new-style (external) Lua candidate actions (with a location key), they will still work for the time being (provided that they use the exec_parms= and/or eval_parms= keys), but we recommend updating them nevertheless. The exec_parms= and eval_parms= keys should be combined into an [args] tag, and the argument list of your execution and evaluation functions should be changed from [c](ai, cfg, self)[/c] to [c](cfg, data)[/c]. The data parameter is the same as self.data was before; however, provided you do not have an explicit [engine] tag, self.data will continue to work. [/list] [/rawarn] diff --git a/changelog b/changelog index 7cee4b20d75..7edf271215c 100644 --- a/changelog +++ b/changelog @@ -114,6 +114,10 @@ Version 1.13.4+dev: built-in effects - for example, to add a new feature to [effect]apply_to=attack. It also now supports effect descriptions, for use by the [trait] tag. + * Additional fields in unit proxy: + * usage, cost - self-explanatory + * traits - list of the IDs of all traits + * abilities - list of the IDs of all abilities * Additional fields in table returned by wesnoth.get_terrain_info: * icon, editor_image, light * LuaAI: @@ -198,7 +202,6 @@ Version 1.13.4+dev: * Dice operator is now synced (where possible) * Modulus (%) operator now works on decimal numbers * Exponentiation (^) operator is now right-associative - * List/map indexing now has highest precedence of any operator (instead of lowest) * Fix several math operations returning a very large negative number when the operation was invalid (for example, (-2) ^ 0.5). Now they return null instead. diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index 43d79560689..83c6ac9558b 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -335,11 +335,11 @@ static int impl_unit_get(lua_State *L) return 1; } if (strcmp(m, "traits") == 0) { - lua_push(L, u.get_ability_list()); + lua_push(L, u.get_traits_list()); return 1; } if (strcmp(m, "abilities") == 0) { - lua_push(L, u.get_traits_list()); + lua_push(L, u.get_ability_list()); return 1; } if (strcmp(m, "status") == 0) {