From dfc81983491417c5cd1c99d7db05e421c409379d Mon Sep 17 00:00:00 2001 From: Andrew Ward Date: Wed, 28 Mar 2018 16:05:18 +0100 Subject: Add reasons to on_dieplayer and on_hpchange --- src/script/cpp_api/s_player.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/script/cpp_api/s_player.h') 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); -- cgit v1.2.3