aboutsummaryrefslogtreecommitdiff
path: root/src/content_sao.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/content_sao.h')
-rw-r--r--src/content_sao.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/content_sao.h b/src/content_sao.h
index f54bc16c2..1321edb91 100644
--- a/src/content_sao.h
+++ b/src/content_sao.h
@@ -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)
+ {}
};