summaryrefslogtreecommitdiff
path: root/src/content_sao.h
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-03-12 07:56:56 +0000
committerrubenwardy <rw@rubenwardy.com>2019-03-12 20:25:48 +0000
commit444ec1e4128e68523f1bbf51aa03e8bf2006156c (patch)
tree2b09dda5ea4135b0a3b38e563b7c2d016d94dc44 /src/content_sao.h
parent82739f4d7d634eaccdc8414382da5d55ae39734d (diff)
downloadminetest-444ec1e4128e68523f1bbf51aa03e8bf2006156c.tar.gz
minetest-444ec1e4128e68523f1bbf51aa03e8bf2006156c.tar.bz2
minetest-444ec1e4128e68523f1bbf51aa03e8bf2006156c.zip
HPChange Reason: Fix push after free, and type being overwritten (#8359)
* HPChange Reason: Fix push after free, and type being overwritten Fixes #8227 and #8344
Diffstat (limited to 'src/content_sao.h')
-rw-r--r--src/content_sao.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/content_sao.h b/src/content_sao.h
index 14f959e30..f54bc16c2 100644
--- a/src/content_sao.h
+++ b/src/content_sao.h
@@ -405,6 +405,11 @@ struct PlayerHPChangeReason {
bool from_mod = false;
int lua_reference = -1;
+ inline bool hasLuaReference() const
+ {
+ return lua_reference >= 0;
+ }
+
bool setTypeFromString(const std::string &typestr)
{
if (typestr == "set_hp")