fix designed-room iso character rendering

This commit is contained in:
jwinterm
2026-07-06 07:04:26 -04:00
parent f505a4fb8a
commit 49ea01606e
88 changed files with 389 additions and 45 deletions
+1
View File
@@ -201,6 +201,7 @@ class Room {
cols: this.cols,
rows: this.rows,
layout: this.layout,
walkable: this.walkable,
solidOccupants: this.solidOccupants,
roomUrl: this.roomUrl || null
};
+15 -1
View File
@@ -54,6 +54,10 @@ function isCharAvatar(id) {
return includes(CHAR_AVATARS, id);
}
function isModel3dAvatar(id) {
return includes(MODEL3D_AVATARS, id);
}
function isPremiumAvatar(id) {
return !!AVATAR_PACKS[id];
}
@@ -99,11 +103,20 @@ function normalizeAppearance(input = {}) {
let avatar = input.avatar || input.id || 'default';
if (!isValidAvatar(avatar)) avatar = 'default';
if (!isCharAvatar(avatar)) {
if (!isCharAvatar(avatar) && !isModel3dAvatar(avatar)) {
return { avatar, tint: 'none', equipment: { ...DEFAULT_EQUIPMENT } };
}
const colors = normalizeColors(input.colors, input.tint);
if (isModel3dAvatar(avatar)) {
return {
avatar,
tint: colors.base,
equipment: { ...DEFAULT_EQUIPMENT },
colors
};
}
return {
avatar,
tint: colors.base,
@@ -129,6 +142,7 @@ module.exports = {
avatarPack,
isValidAvatar,
isCharAvatar,
isModel3dAvatar,
isPremiumAvatar,
normalizeEquipment,
normalizeColors,