fix(multiplayer): replicate per-player avatar loadout and preserve original materials
checkpoint / checkpoint (push) Successful in 5m57s
checkpoint / checkpoint (push) Successful in 5m57s
This commit is contained in:
@@ -329,7 +329,15 @@ func _prime_avatar() -> void:
|
||||
var res: Dictionary = await ApiClient.get_avatar_loadout()
|
||||
if res.ok and res.data is Dictionary and (res.data as Dictionary).has("data"):
|
||||
avatars.set_loadout_from_dict((res.data as Dictionary)["data"])
|
||||
else:
|
||||
elif FileAccess.file_exists("user://loadout.json"):
|
||||
var f := FileAccess.open("user://loadout.json", FileAccess.READ)
|
||||
if f != null:
|
||||
var txt := f.get_as_text()
|
||||
f.close()
|
||||
var dict: Variant = JSON.parse_string(txt)
|
||||
if dict is Dictionary:
|
||||
avatars.set_loadout_from_dict(dict as Dictionary)
|
||||
elif not avatars.has_loadout():
|
||||
# No saved loadout reachable -- fall back to the catalog's first base body.
|
||||
var bases: Array = avatars.get_assets_for_slot("base_body")
|
||||
if bases.size() > 0:
|
||||
|
||||
Reference in New Issue
Block a user