1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-29 22:55:19 +01:00

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
This commit is contained in:
rubenwardy
2019-03-12 07:56:56 +00:00
committed by Loïc Blot
parent 3b25b807f3
commit 1e3e4fb649
3 changed files with 17 additions and 5 deletions

View File

@@ -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")