Source-Python-Dev-Team / Source.Python

This plugin aims to use boost::python and create an easily accessible wrapper around the Source Engine API for scripter use.
http://forums.sourcepython.com
GNU General Public License v3.0
164 stars 32 forks source link

Conversion issues during entity deletion listener callbacks. #455

Closed jordanbriere closed 2 years ago

jordanbriere commented 2 years ago

Originally reported into: 2729

The issue appears to be that m_pUnk is already unbound at that point causing our conversion to fail.

Reproducible code for bots on TF2:

from listeners import OnEntityDeleted
from entities.helpers import baseentity_from_index

@OnEntityDeleted
def _(base_entity):
    baseentity_from_index(base_entity.index)
ValueError: Conversion from "Index" (2) to "BaseEntity" failed.

Not sure if other entities/other games are affected, but we might want to temporarily rebind it like we rebind m_pNetworkable to fix similar issues during entity creation callbacks.