Add infotext containing entity type (e.g. mobs:cow) to unknown entities (#4431)
authorRogier-5 <rogier777@gmail.com>
Wed, 10 Aug 2016 22:22:32 +0000 (00:22 +0200)
committerNer'zhul <nerzhul@users.noreply.github.com>
Wed, 10 Aug 2016 22:22:32 +0000 (00:22 +0200)
If a mod is disabled, or upgraded without sufficient backward compatibility,
then entities it has put into the world become unknown, and continue moving
around, but are completely unrecognisable.

This change allows the player to see their type, and therefore which mod is
or was responsible.

src/content_sao.cpp

index 53bf3154f593fb39c429876e850fe9280c141da9..937363b763035fcf4b5de54d92cb8abc54dd5cdc 100644 (file)
@@ -175,6 +175,8 @@ void LuaEntitySAO::addedToEnvironment(u32 dtime_s)
                // Activate entity, supplying serialized state
                m_env->getScriptIface()->
                        luaentity_Activate(m_id, m_init_state.c_str(), dtime_s);
+       } else {
+               m_prop.infotext = m_init_name;
        }
 }