From b8aaef704d3e29c43edc3312a3c5e25516d9c864 Mon Sep 17 00:00:00 2001 From: Beha Date: Tue, 30 Jul 2019 11:29:45 -0400 Subject: 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). --- src/content_sao.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 41b1aec18..84a09d977 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -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 -- cgit v1.2.3