diff options
author | Paul Ouellette <oue.paul18@gmail.com> | 2019-04-11 15:45:39 -0400 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2019-04-11 20:45:39 +0100 |
commit | 22ad820aa459e055fde817d94f31a9461aac2726 (patch) | |
tree | 8df2ea572c26ecf3f4e0c37208c5556281a47221 /src/content_sao.h | |
parent | 1e5f2e0f133af42764dcd9386ccd59f4bf948328 (diff) | |
download | minetest-22ad820aa459e055fde817d94f31a9461aac2726.tar.gz minetest-22ad820aa459e055fde817d94f31a9461aac2726.tar.bz2 minetest-22ad820aa459e055fde817d94f31a9461aac2726.zip |
Add node field to PlayerHPChangeReason table (#8368)
Diffstat (limited to 'src/content_sao.h')
-rw-r--r-- | src/content_sao.h | 16 |
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) + {} }; |