aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_player.h
diff options
context:
space:
mode:
authorAndrew Ward <rw@rubenwardy.com>2018-03-28 16:05:18 +0100
committerGitHub <noreply@github.com>2018-03-28 16:05:18 +0100
commitdfc81983491417c5cd1c99d7db05e421c409379d (patch)
tree7b0457f0ff86f038cfad1a095d3ab0b6c44f2def /src/script/cpp_api/s_player.h
parent2323842dd3dd336b087ca3cf9756e0680b3a1244 (diff)
downloadminetest-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.h6
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);