aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorJDiaz <runspect@gmail.com>2021-01-11 18:03:31 +0100
committerGitHub <noreply@github.com>2021-01-11 18:03:31 +0100
commit08ee9794fbc0960a8aab1af21d34f40685809e75 (patch)
treeeb6acad972eca4793159c95519b4deb6e05c9448 /src/server
parentfcb3ed840a5e66e6d37b27effe30d8d723a7da59 (diff)
downloadminetest-08ee9794fbc0960a8aab1af21d34f40685809e75.tar.gz
minetest-08ee9794fbc0960a8aab1af21d34f40685809e75.tar.bz2
minetest-08ee9794fbc0960a8aab1af21d34f40685809e75.zip
Implement on_rightclickplayer callback (#10775)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
Diffstat (limited to 'src/server')
-rw-r--r--src/server/player_sao.cpp5
-rw-r--r--src/server/player_sao.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/server/player_sao.cpp b/src/server/player_sao.cpp
index 232c6a01d..c1b1401e6 100644
--- a/src/server/player_sao.cpp
+++ b/src/server/player_sao.cpp
@@ -456,6 +456,11 @@ u16 PlayerSAO::punch(v3f dir,
return hitparams.wear;
}
+void PlayerSAO::rightClick(ServerActiveObject *clicker)
+{
+ m_env->getScriptIface()->on_rightclickplayer(this, clicker);
+}
+
void PlayerSAO::setHP(s32 hp, const PlayerHPChangeReason &reason)
{
if (hp == (s32)m_hp)
diff --git a/src/server/player_sao.h b/src/server/player_sao.h
index 3e178d4fc..6aee8d5aa 100644
--- a/src/server/player_sao.h
+++ b/src/server/player_sao.h
@@ -111,7 +111,7 @@ public:
u16 punch(v3f dir, const ToolCapabilities *toolcap, ServerActiveObject *puncher,
float time_from_last_punch);
- void rightClick(ServerActiveObject *clicker) {}
+ void rightClick(ServerActiveObject *clicker);
void setHP(s32 hp, const PlayerHPChangeReason &reason);
void setHPRaw(u16 hp) { m_hp = hp; }
s16 readDamage();