mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-10-19 07:08:33 +02:00
fix(render): default avatar renders as a real character, not a grey circle
A player who never customized arrives as avatar 'default' — not a char/skin/model, so avatarVisuals resolved it to 'legacy' kind with no sprite and the renderer drew the grey fallback circle (while NPCs with explicit char-* avatars rendered fine). Coerce any unknown/'default' avatar to 'char-villager' on the 2D topdown path so nobody is ever a grey dot in a room of people. iso/3d keep their own fallbacks.
This commit is contained in:
@@ -88,6 +88,15 @@
|
||||
opts = opts || {};
|
||||
var ap = normalize(appearance);
|
||||
var projection = opts.projection || 'legacy-rot';
|
||||
// A player who never customized arrives as avatar 'default' (or an unknown id), which is not
|
||||
// a char/skin/model and would fall to the grey circle. On the 2D topdown/tavern path, coerce
|
||||
// it to a real Kenney character so nobody is ever a grey dot in a room of people. (iso/3d
|
||||
// keep their own fallbacks below.)
|
||||
if (ap && projection !== 'iso' && projection !== '3d') {
|
||||
var a = ap.avatar;
|
||||
var known = (RK.isChar && RK.isChar(a)) || (RK.isSkin && RK.isSkin(a)) || (a && /^kenney-/.test(a));
|
||||
if (!known) ap = Object.assign({}, ap, { avatar: 'char-villager' });
|
||||
}
|
||||
var kind = kindFor(ap, projection);
|
||||
var pack = packFor(ap, kind, projection);
|
||||
var visual = {
|
||||
|
||||
Reference in New Issue
Block a user