Garry's Mod Wiki

Revision Difference

InvalidateInternalEntityCache#564958

<function name="InvalidateInternalEntityCache" parent="Global" type="libraryfunc"> <description> <bug issue="6387">Argument ent returns a Boolean and an entity. In addition, the PlayerCache variable is reset to nil each time an entity appears or is deleted, whether it's a player or not.</bug>⤶ <internal></internal> Called by the engine before <page>GM:OnEntityCreated</page> and after <page>GM:EntityRemoved</page> hooks are called. Internally used to clear the <page>player.Iterator</page> and <page>ents.Iterator</page> cache Internally used to clear the <page>player.Iterator</page> or <page>ents.Iterator</page> cache </description> <realm>Shared</realm> <added>2025.06.12</added> <file line="22-L28">lua/includes/extensions/entity_iter.lua</file>⤶ <args> <arg name="ent" type="Entity">An entity that is about to be removed or that has just been created.</arg>⤶ <arg name="isPly" type="boolean">Reset the <page>player.Iterator</page> cache</arg>⤶ </args> </function>