Restore each imported appearance field on its own

An import with color but no chat_color or tag assigned nil to the missing
LuaPlayer properties and failed restoration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-18 19:53:36 +00:00
1 parent 41dc294542
commit feb3253bec
2 files changed
+6 -4

No files matched your search

+5 -4
View File
@@ -1324,10 +1324,11 @@ function serialize.deserialize_player(player, serialized, components, local_cont
end
end
if syncs(components, "appearance") and serialized.color then
player.color = serialized.color
player.chat_color = serialized.chat_color
player.tag = serialized.tag
if syncs(components, "appearance") then
-- Imports may supply any subset of these
if serialized.color then player.color = serialized.color end
if serialized.chat_color then player.chat_color = serialized.chat_color end
if serialized.tag then player.tag = serialized.tag end
end
if syncs(components, "force") and serialized.force then
player.force = serialized.force