From ddab98412f3fc47eedfa74f8a4edafd324e59707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Thu, 28 Nov 2019 12:30:21 +0100 Subject: Add static_save and prevent UDP connect exhaustions This merges two pull requests from 5.0 --- src/script/common/c_content.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/script/common/c_content.cpp') diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index c0e29abf0..24b84e0d0 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -273,7 +273,10 @@ void read_object_properties(lua_State *L, int index, prop->automatic_face_movement_max_rotation_per_sec = luaL_checknumber(L, -1); } lua_pop(L, 1); + getstringfield(L, -1, "infotext", prop->infotext); + getboolfield(L, -1, "static_save", prop->static_save); + lua_getfield(L, -1, "wield_item"); if (!lua_isnil(L, -1)) prop->wield_item = read_item(L, -1, idef).getItemString(); @@ -346,6 +349,8 @@ void push_object_properties(lua_State *L, ObjectProperties *prop) lua_setfield(L, -2, "automatic_face_movement_max_rotation_per_sec"); lua_pushlstring(L, prop->infotext.c_str(), prop->infotext.size()); lua_setfield(L, -2, "infotext"); + lua_pushboolean(L, prop->static_save); + lua_setfield(L, -2, "static_save"); lua_pushlstring(L, prop->wield_item.c_str(), prop->wield_item.size()); lua_setfield(L, -2, "wield_item"); } -- cgit v1.2.3