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:
@@ -168,6 +168,9 @@ var _movable: ESCMovable = null
|
|||||||
# The identified animation player
|
# The identified animation player
|
||||||
var _animation_player: ESCAnimationPlayer = null
|
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
|
# Add the movable node, connect signals, detect child nodes
|
||||||
# and register this item
|
# and register this item
|
||||||
@@ -210,7 +213,7 @@ func _ready():
|
|||||||
self
|
self
|
||||||
),
|
),
|
||||||
null,
|
null,
|
||||||
true
|
_force_registration
|
||||||
)
|
)
|
||||||
|
|
||||||
terrain = escoria.room_terrain
|
terrain = escoria.room_terrain
|
||||||
|
|||||||
@@ -39,7 +39,5 @@ func _ready():
|
|||||||
ESCObject.new(
|
ESCObject.new(
|
||||||
self.global_id,
|
self.global_id,
|
||||||
self
|
self
|
||||||
),
|
)
|
||||||
null,
|
|
||||||
true
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export(bool) var selectable = false
|
|||||||
# A player is always movable
|
# A player is always movable
|
||||||
func _init():
|
func _init():
|
||||||
is_movable = true
|
is_movable = true
|
||||||
|
_force_registration = true
|
||||||
|
|
||||||
|
|
||||||
# Ready function
|
# Ready function
|
||||||
|
|||||||
Reference in New Issue
Block a user