aboutsummaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r--src/content_sao.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index 5119223a7..75c3eaf37 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -653,7 +653,7 @@ u16 LuaEntitySAO::punch(v3f dir,
if (!damage_handled) {
if (result.did_punch) {
setHP((s32)getHP() - result.damage,
- PlayerHPChangeReason(PlayerHPChangeReason::SET_HP));
+ PlayerHPChangeReason(PlayerHPChangeReason::PLAYER_PUNCH, puncher));
std::string str = gob_cmd_punched(getHP());
// create message and add to list
@@ -663,10 +663,10 @@ u16 LuaEntitySAO::punch(v3f dir,
}
if (getHP() == 0 && !isGone()) {
- m_pending_removal = true;
clearParentAttachment();
clearChildAttachments();
m_env->getScriptIface()->luaentity_on_death(m_id, puncher);
+ m_pending_removal = true;
}
actionstream << puncher->getDescription() << " (id=" << puncher->getId() <<
@@ -675,6 +675,7 @@ u16 LuaEntitySAO::punch(v3f dir,
"), damage=" << (old_hp - (s32)getHP()) <<
(damage_handled ? " (handled by Lua)" : "") << std::endl;
+ // TODO: give Lua control over wear
return result.wear;
}