show proper error message when add entity
This commit is contained in:
parent
dc32cac1e2
commit
927521419f
|
@ -174,7 +174,7 @@ func create_entity(entity_id: String, entity_position: Vector3, type=null):
|
|||
var room = find_room_at(entity_position)
|
||||
|
||||
if room == null:
|
||||
return null
|
||||
return false
|
||||
|
||||
var entity = EntityFactory.create_entity(entity_id, type)
|
||||
|
||||
|
@ -192,7 +192,7 @@ func create_entity_in(entity_id: String, room_name: String, type=null):
|
|||
var room = find_room(room_name)
|
||||
|
||||
if room == null:
|
||||
return null
|
||||
return false
|
||||
|
||||
var entity = EntityFactory.create_entity(entity_id, type)
|
||||
|
||||
|
|
|
@ -21,8 +21,11 @@ func _ready():
|
|||
|
||||
var entity=House.body.create_entity(entity_name, global_position)
|
||||
|
||||
if entity == null:
|
||||
if entity == false:
|
||||
EventSystem.notify("Entity is not in Room", EventNotify.Type.INFO)
|
||||
|
||||
if entity == null:
|
||||
EventSystem.notify("This Entity is not supported yet", EventNotify.Type.INFO)
|
||||
)
|
||||
|
||||
entities_page.on_back.connect(func():
|
||||
|
|
Loading…
Reference in New Issue
Block a user