From 1390c8be7485e6f3b5f779b31015abc9eca73e70 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Fri, 9 Feb 2018 07:48:15 +1100 Subject: [PATCH] Added unit_type.profile and unit_type.small_profile getters (fixes #1468) There are probably more [unit_type] getters I should add, but this addresses the immediate issue brought up in the feature request. --- changelog | 1 + src/scripting/lua_unit_type.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/changelog b/changelog index 9390b45ade73..a373fa4a7721 100644 --- a/changelog +++ b/changelog @@ -41,6 +41,7 @@ Version 1.13.11: * Allow moving on-map units by setting unit.x and unit.y fields, or with unit.loc = {x, y} or unit.loc = {x = x, y = y} * Added side.chose_random getter. + * Added unit_type.profile and unit_type.small_profile getters. * Multiplayer: * Dark Forecast: Fixed broken faction and leader selection. * Rename the Khalifate to Dunefolk. This includes renaming all the faction's diff --git a/src/scripting/lua_unit_type.cpp b/src/scripting/lua_unit_type.cpp index e79389d0f617..66288c788954 100644 --- a/src/scripting/lua_unit_type.cpp +++ b/src/scripting/lua_unit_type.cpp @@ -51,6 +51,8 @@ static int impl_unit_type_get(lua_State *L) return_string_attrib("race", ut.race_id()); return_string_attrib("image", ut.image()); return_string_attrib("icon", ut.icon()); + return_string_attrib("profile", ut.big_profile()); + return_string_attrib("small_profile", ut.small_profile()); return_int_attrib("max_hitpoints", ut.hitpoints()); return_int_attrib("max_moves", ut.movement()); return_int_attrib("max_experience", ut.experience_needed());