mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-18 02:45:21 +02:00
Fix a warning introduced by c5b4e54174
This commit is contained in:
@@ -566,7 +566,8 @@ int LuaEntitySAO::punch(v3f dir,
|
||||
|
||||
if (!damage_handled) {
|
||||
if (result.did_punch) {
|
||||
setHP(getHP() - result.damage);
|
||||
setHP(getHP() - result.damage,
|
||||
PlayerHPChangeReason(PlayerHPChangeReason::SET_HP));
|
||||
|
||||
if (result.damage > 0) {
|
||||
std::string punchername = puncher ? puncher->getDescription() : "nil";
|
||||
@@ -634,9 +635,10 @@ std::string LuaEntitySAO::getDescription()
|
||||
return os.str();
|
||||
}
|
||||
|
||||
void LuaEntitySAO::setHP(s16 hp)
|
||||
void LuaEntitySAO::setHP(s16 hp, const PlayerHPChangeReason &reason)
|
||||
{
|
||||
if(hp < 0) hp = 0;
|
||||
if (hp < 0)
|
||||
hp = 0;
|
||||
m_hp = hp;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user