mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-22 04:15:44 +02:00
Move the clamping of hp/breath when their maximums change to read_object_properties(). (#8689)
This prevents set_properties() calls that have nothing to do with hp_max or breath_max overriding the saved hp before another mod has the chance to set a player's intended hp_max (such as in on_joinplayer).
This commit is contained in:
@@ -331,7 +331,7 @@ void LuaEntitySAO::addedToEnvironment(u32 dtime_s)
|
||||
if(m_registered){
|
||||
// Get properties
|
||||
m_env->getScriptIface()->
|
||||
luaentity_GetProperties(m_id, &m_prop);
|
||||
luaentity_GetProperties(m_id, this, &m_prop);
|
||||
// Initialize HP from properties
|
||||
m_hp = m_prop.hp_max;
|
||||
// Activate entity, supplying serialized state
|
||||
|
Reference in New Issue
Block a user