diff options
author | Andrew Ward <rw@rubenwardy.com> | 2018-03-28 16:05:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-28 16:05:18 +0100 |
commit | dfc81983491417c5cd1c99d7db05e421c409379d (patch) | |
tree | 7b0457f0ff86f038cfad1a095d3ab0b6c44f2def /src/script/cpp_api/s_player.h | |
parent | 2323842dd3dd336b087ca3cf9756e0680b3a1244 (diff) | |
download | minetest-dfc81983491417c5cd1c99d7db05e421c409379d.tar.gz minetest-dfc81983491417c5cd1c99d7db05e421c409379d.tar.bz2 minetest-dfc81983491417c5cd1c99d7db05e421c409379d.zip |
Add reasons to on_dieplayer and on_hpchange
Diffstat (limited to 'src/script/cpp_api/s_player.h')
-rw-r--r-- | src/script/cpp_api/s_player.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/script/cpp_api/s_player.h b/src/script/cpp_api/s_player.h index 562805695..59e1505ae 100644 --- a/src/script/cpp_api/s_player.h +++ b/src/script/cpp_api/s_player.h @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/string.h" struct ToolCapabilities; +struct PlayerHPChangeReason; class ScriptApiPlayer : virtual public ScriptApiBase { @@ -31,7 +32,7 @@ public: virtual ~ScriptApiPlayer() = default; void on_newplayer(ServerActiveObject *player); - void on_dieplayer(ServerActiveObject *player); + void on_dieplayer(ServerActiveObject *player, const PlayerHPChangeReason &reason); bool on_respawnplayer(ServerActiveObject *player); bool on_prejoinplayer(const std::string &name, const std::string &ip, std::string *reason); @@ -42,7 +43,8 @@ public: bool on_punchplayer(ServerActiveObject *player, ServerActiveObject *hitter, float time_from_last_punch, const ToolCapabilities *toolcap, v3f dir, s16 damage); - s16 on_player_hpchange(ServerActiveObject *player, s16 hp_change); + s16 on_player_hpchange(ServerActiveObject *player, s16 hp_change, + const PlayerHPChangeReason &reason); void on_playerReceiveFields(ServerActiveObject *player, const std::string &formname, const StringMap &fields); void on_auth_failure(const std::string &name, const std::string &ip); |