[HL2DM] Variant.type crashing
Posted: Tue Nov 17, 2020 3:43 am
Running the following code with an npc_cscanner that's set to hate players (e.g. temp_scanner) causes a crash: Looking through the HL2SDK, I found that the OnFoundPlayer output is defined as a COutputEHANDLE data type. Seeing as other outputs are defined as COutputEvent, could this difference in type be the cause of the crash?
Syntax: Select all
# ../scanner_output/scanner_output.py
# Source.Python
from listeners import OnEntityOutput
@OnEntityOutput
def on_entity_output(output, activator, caller, value, delay):
if 'OnFoundPlayer' in output:
# print(value): <_entities._datamaps.Variant object at 0x1E800228>
print(value.type)