fix: prevents duplicate item registration (#587)

* fix: prevents duplicate item registration and also ensures that the player is forcibly registered
* updates ESCLocation to respect duplicate registration rules
This commit is contained in:
Duncan Brown
2022-05-13 04:49:14 -04:00
committed by GitHub
parent 3304d11579
commit 0fd0ba45ae
3 changed files with 6 additions and 4 deletions

View File

@@ -168,6 +168,9 @@ var _movable: ESCMovable = null
# The identified animation player
var _animation_player: ESCAnimationPlayer = null
# Whether to force regsitration with the object manager. Defaults to false.
var _force_registration: bool = false
# Add the movable node, connect signals, detect child nodes
# and register this item
@@ -210,7 +213,7 @@ func _ready():
self
),
null,
true
_force_registration
)
terrain = escoria.room_terrain

View File

@@ -39,7 +39,5 @@ func _ready():
ESCObject.new(
self.global_id,
self
),
null,
true
)
)

View File

@@ -13,6 +13,7 @@ export(bool) var selectable = false
# A player is always movable
func _init():
is_movable = true
_force_registration = true
# Ready function