File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
addons/source-python/packages/source-python/entities/engines/csgo Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 55# =============================================================================
66# >> IMPORTS
77# =============================================================================
8- # Source.Python Imports
8+ # Source.Python
9+ from entities import BaseEntityGenerator
910from entities ._base import Entity as _Entity
1011from weapons .manager import weapon_manager
1112
@@ -44,18 +45,22 @@ def create(cls, classname):
4445
4546 @classmethod
4647 def find (cls , classname ):
47- from filters .entities import BaseEntityIter
4848 index = _weapon_names_for_definition .get (classname )
4949 if classname in _weapon_parents and index is not None :
50- for entity in BaseEntityIter (_weapon_parents [classname ]):
50+ parent_classname = _weapon_parents [classname ]
51+ for entity in BaseEntityGenerator ():
52+ if entity .classname != parent_classname :
53+ continue
5154 if not entity .is_networked ():
5255 continue
5356 if entity .get_network_property_int (
5457 'm_AttributeManager.m_Item.m_iItemDefinitionIndex'
5558 ) == index :
5659 return cls (entity .index )
5760 elif classname in _parent_weapons :
58- for entity in BaseEntityIter (classname ):
61+ for entity in BaseEntityGenerator ():
62+ if entity .classname != classname :
63+ continue
5964 if not entity .is_networked ():
6065 continue
6166 if entity .get_network_property_int (
You can’t perform that action at this time.
0 commit comments