From edbc533414b0ba991a82f8003d90924e1dc60d95 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Fri, 15 Sep 2017 12:18:47 +0200 Subject: Customizeable max breath for players (#6411) * Customizeable maximal breath for players --- src/script/common/c_content.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/script/common') diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 206ca55d0..557430471 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -193,6 +193,7 @@ void read_object_properties(lua_State *L, int index, if (getintfield(L, -1, "hp_max", hp_max)) prop->hp_max = (s16)rangelim(hp_max, 0, S16_MAX); + getintfield(L, -1, "breath_max", prop->breath_max); getboolfield(L, -1, "physical", prop->physical); getboolfield(L, -1, "collide_with_objects", prop->collideWithObjects); @@ -306,6 +307,8 @@ void push_object_properties(lua_State *L, ObjectProperties *prop) lua_newtable(L); lua_pushnumber(L, prop->hp_max); lua_setfield(L, -2, "hp_max"); + lua_pushnumber(L, prop->breath_max); + lua_setfield(L, -2, "breath_max"); lua_pushboolean(L, prop->physical); lua_setfield(L, -2, "physical"); lua_pushboolean(L, prop->collideWithObjects); -- cgit v1.2.3