diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hud.cpp | 1 | ||||
-rw-r--r-- | src/script/common/c_content.cpp | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/hud.cpp b/src/hud.cpp index 3079b5cd8..4830c56a4 100644 --- a/src/hud.cpp +++ b/src/hud.cpp @@ -40,6 +40,7 @@ const struct EnumString es_HudElementStat[] = {HUD_STAT_TEXT, "text"}, {HUD_STAT_NUMBER, "number"}, {HUD_STAT_ITEM, "item"}, + {HUD_STAT_ITEM, "precision"}, {HUD_STAT_DIR, "direction"}, {HUD_STAT_ALIGN, "alignment"}, {HUD_STAT_OFFSET, "offset"}, diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 3dfd7ce61..774b6a326 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -1959,9 +1959,10 @@ void push_hud_element(lua_State *L, HudElement *elem) HudElementStat read_hud_change(lua_State *L, HudElement *elem, void **value) { HudElementStat stat = HUD_STAT_NUMBER; + std::string statstr; if (lua_isstring(L, 3)) { int statint; - std::string statstr = lua_tostring(L, 3); + statstr = lua_tostring(L, 3); stat = string_to_enum(es_HudElementStat, statint, statstr) ? (HudElementStat)statint : stat; } @@ -1989,6 +1990,8 @@ HudElementStat read_hud_change(lua_State *L, HudElement *elem, void **value) break; case HUD_STAT_ITEM: elem->item = luaL_checknumber(L, 4); + if (elem->type == HUD_ELEM_WAYPOINT && statstr == "precision") + elem->item++; *value = &elem->item; break; case HUD_STAT_DIR: |