Don't set the interaction type to loot if an entity doesn't have a lootdb.

This commit is contained in:
Relintai 2020-05-06 21:58:58 +02:00
parent 39827852b3
commit b3418a8c84

View File

@ -50,6 +50,8 @@ func sstart_attack(entity : Entity) -> void:
func _notification_cmouse_enter() -> void:
if centity_interaction_type == EntityEnums.ENITIY_INTERACTION_TYPE_LOOT:
Input.set_default_cursor_shape(Input.CURSOR_CROSS)
elif centity_interaction_type == EntityEnums.ENITIY_INTERACTION_TYPE_NONE:
Input.set_default_cursor_shape(Input.CURSOR_ARROW)
else:
Input.set_default_cursor_shape(Input.CURSOR_MOVE)
@ -84,7 +86,11 @@ func _notification_sdeath():
starget = null
sentity_interaction_type = EntityEnums.ENITIY_INTERACTION_TYPE_LOOT
if sentity_data.loot_db != null:
sentity_interaction_type = EntityEnums.ENITIY_INTERACTION_TYPE_LOOT
else:
sentity_interaction_type = EntityEnums.ENITIY_INTERACTION_TYPE_NONE
ai_state = EntityEnums.AI_STATE_OFF