Warning message added when location cant be reached.

This commit is contained in:
Balloonpopper authored and Julian Murgia committed 2022-08-12 16:58:33 +02:00
1 parent da007889b6
commit 9de6c1fe62
2 files changed
+15

No files matched your search

@@ -540,6 +540,20 @@ func perform_inputevent_on_object(
if not player_global_pos.is_equal_approx(destination_position): if not player_global_pos.is_equal_approx(destination_position):
dont_interact = true dont_interact = true
escoria.logger.info(
self,
"Player could not reach destination coordinates %s. " % str(destination_position) \
+ "Any requested action for %s will not fire." % obj.global_id
)
if escoria.event_manager.EVENT_CANT_REACH in obj.events:
escoria.event_manager.queue_event(obj.events[escoria.event_manager.EVENT_CANT_REACH])
else:
escoria.logger.info(
self,
"%s event not found for object %s so nothing to do." % \
[escoria.event_manager.EVENT_CANT_REACH, obj.global_id]
)
# If no interaction should happen after player has arrived, leave # If no interaction should happen after player has arrived, leave
# immediately. # immediately.
@@ -31,6 +31,7 @@ const EVENT_ROOM_SELECTOR = "room_selector"
const EVENT_SETUP = "setup" const EVENT_SETUP = "setup"
const EVENT_TRANSITION_IN = "transition_in" const EVENT_TRANSITION_IN = "transition_in"
const EVENT_TRANSITION_OUT = "transition_out" const EVENT_TRANSITION_OUT = "transition_out"
const EVENT_CANT_REACH = "cant_reach"
# Event channel names # Event channel names