refactor: route core definitions through content catalog

This commit is contained in:
Rijad Zuzo
2026-08-12 20:13:50 +02:00
parent 758d240438
commit c218909649
6 changed files with 50 additions and 55 deletions
+6 -2
View File
@@ -3,6 +3,7 @@ extends RefCounted
const SCHEMA_VERSION := 1
const ENTITY_TYPE_NPC := &"npc"
const ENTITY_TYPE_PLAYER := &"player"
const ENTITY_TYPE_WORLD := &"world_entity"
const ROLE_ACTOR := &"actor"
const ROLE_SOURCE := &"source"
@@ -102,9 +103,12 @@ static func from_economic_event(
if economic_event == null:
return null
var economic_data := economic_event.to_dictionary()
var actor_id := int(economic_data["actor_id"])
var actor_type := (
ENTITY_TYPE_PLAYER if actor_id == SimulationIds.PLAYER_ACTOR_ID else ENTITY_TYPE_NPC
)
var participants: Dictionary = {
ROLE_ACTOR:
WorldEntityRef.create(ENTITY_TYPE_NPC, StringName(str(int(economic_data["actor_id"]))))
ROLE_ACTOR: WorldEntityRef.create(actor_type, StringName(str(actor_id)))
}
var source_id := StringName(economic_data["source_id"])
if not source_id.is_empty():