Mob fixes.
This commit is contained in:
@@ -300,10 +300,20 @@ func _handle_dungeon_enter(data: Dictionary):
|
||||
var pid = p.get("id", p.get("Id"))
|
||||
portals[pid] = p
|
||||
|
||||
# Parse mob catalog if included in the dungeon-enter response
|
||||
var catalog = data.get("mobCatalog", data.get("MobCatalog", []))
|
||||
if catalog is Array and catalog.size() > 0:
|
||||
for entry in catalog:
|
||||
var cid = entry.get("id", entry.get("Id"))
|
||||
if cid != null:
|
||||
mob_catalog[cid] = entry
|
||||
print("[GameState] Mob catalog from enter: %d entries" % catalog.size())
|
||||
_prefetch_mob_textures_from_list(catalog)
|
||||
|
||||
# Prefetch mob textures early on web (mobs list is included in enter payload)
|
||||
var mobs_list = data.get("mobs", data.get("Mobs", []))
|
||||
_prefetch_mob_textures_from_list(mobs_list)
|
||||
|
||||
|
||||
set_state(STATE_PLAYING)
|
||||
dungeon_entered.emit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user