1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Improve waypoints and add image variant (#9480)

This commit is contained in:
Lars Müller 2020-04-11 23:09:46 +02:00 committed by GitHub
parent f780bae05c
commit af2e6a6a10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 118 additions and 47 deletions

View file

@ -1850,7 +1850,11 @@ void read_hud_element(lua_State *L, HudElement *elem)
elem->name = getstringfield_default(L, 2, "name", "");
elem->text = getstringfield_default(L, 2, "text", "");
elem->number = getintfield_default(L, 2, "number", 0);
elem->item = getintfield_default(L, 2, "item", 0);
if (elem->type == HUD_ELEM_WAYPOINT)
// waypoints reuse the item field to store precision, item = precision + 1
elem->item = getintfield_default(L, 2, "precision", -1) + 1;
else
elem->item = getintfield_default(L, 2, "item", 0);
elem->dir = getintfield_default(L, 2, "direction", 0);
elem->z_index = MYMAX(S16_MIN, MYMIN(S16_MAX,
getintfield_default(L, 2, "z_index", 0)));