fix: avoids crashing when selected_action is null (#586)
* fix: avoids crashing when selected_action is null * fix: more robust handling suggested by @straton
This commit is contained in:
@@ -180,6 +180,14 @@ func left_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func right_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
func right_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||||
|
element_focused(item_global_id)
|
||||||
|
var object = escoria.object_manager.get_object(item_global_id)
|
||||||
|
if object != null:
|
||||||
|
verbs_menu.set_by_name(object.node.default_action)
|
||||||
|
|
||||||
|
if verbs_menu.selected_action == null:
|
||||||
|
return
|
||||||
|
|
||||||
escoria.action_manager.set_current_action(verbs_menu.selected_action)
|
escoria.action_manager.set_current_action(verbs_menu.selected_action)
|
||||||
escoria.action_manager.do(
|
escoria.action_manager.do(
|
||||||
escoria.action_manager.ACTION.ITEM_RIGHT_CLICK,
|
escoria.action_manager.ACTION.ITEM_RIGHT_CLICK,
|
||||||
|
|||||||
Reference in New Issue
Block a user