Skip to content

Commit bf61fec

Browse files
committed
Updated EntityOutput listener to use Entity objects if the entities are networked
1 parent d42cac8 commit bf61fec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

addons/source-python/packages/source-python/listeners/_entity_output.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from memory.manager import manager
1919
# Entity
2020
from entities.entity import BaseEntity
21+
from entities.entity import Entity
2122
from entities.datamaps import Variant
2223
# Listeners
2324
from _listeners import _ListenerManager
@@ -61,12 +62,17 @@ def _pre_fire_output(args):
6162
if output_name is None:
6263
return None
6364

65+
if caller.is_networked():
66+
caller = memory.make_object(Entity, caller_ptr)
67+
6468
value_ptr = args[1]
6569
value = (value_ptr or None) and memory.make_object(Variant, value_ptr)
6670

6771
activator_ptr = args[2]
6872
activator = ((activator_ptr or None) and memory.make_object(
6973
BaseEntity, activator_ptr))
74+
if activator is not None and activator.is_networked():
75+
activator = memory.make_object(Entity, activator_ptr)
7076

7177
delay = args[4]
7278
entity_output_listener_manager.notify(

0 commit comments

Comments
 (0)