1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-30 23:15:32 +01:00

Add node field to PlayerHPChangeReason table (#8368)

This commit is contained in:
Paul Ouellette
2019-04-11 15:45:39 -04:00
committed by rubenwardy
parent 1e5f2e0f13
commit 22ad820aa4
5 changed files with 39 additions and 14 deletions

View File

@@ -401,10 +401,14 @@ struct PlayerHPChangeReason {
};
Type type = SET_HP;
ServerActiveObject *object;
bool from_mod = false;
int lua_reference = -1;
// For PLAYER_PUNCH
ServerActiveObject *object = nullptr;
// For NODE_DAMAGE
std::string node;
inline bool hasLuaReference() const
{
return lua_reference >= 0;
@@ -450,7 +454,15 @@ struct PlayerHPChangeReason {
}
}
PlayerHPChangeReason(Type type, ServerActiveObject *object=NULL):
PlayerHPChangeReason(Type type):
type(type)
{}
PlayerHPChangeReason(Type type, ServerActiveObject *object):
type(type), object(object)
{}
PlayerHPChangeReason(Type type, std::string node):
type(type), node(node)
{}
};