summaryrefslogtreecommitdiff
path: root/src/script/common
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2017-09-15 12:18:47 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-09-15 12:18:47 +0200
commitedbc533414b0ba991a82f8003d90924e1dc60d95 (patch)
tree9fe4c04bc35f345e9a62f1358fa5e0ad324938e9 /src/script/common
parent7640749d68b87a62868840d34a665101861ca9c0 (diff)
downloadminetest-edbc533414b0ba991a82f8003d90924e1dc60d95.tar.gz
minetest-edbc533414b0ba991a82f8003d90924e1dc60d95.tar.bz2
minetest-edbc533414b0ba991a82f8003d90924e1dc60d95.zip
Customizeable max breath for players (#6411)
* Customizeable maximal breath for players
Diffstat (limited to 'src/script/common')
-rw-r--r--src/script/common/c_content.cpp3
1 files changed, 3 insertions, 0 deletions
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);