Skip to content

Commit

Permalink
Fix mergeNpcDataWithNpcIconData errors in console due to incorrect ic…
Browse files Browse the repository at this point in the history
…on format on changed npcs
  • Loading branch information
KrisAphalon committed Nov 23, 2024
1 parent 837b171 commit 3cd79ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/npc/update-npc-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ export async function updateNpcWithCustomGifImage(npc, gifIconUrl)

export function updateNpcWithGameImage(npc, imgUrl)
{
Object.defineProperty(npc.d, 'icon', {
get() {return imgUrl}, set() {}
})
const beforeOnload = npc.beforeOnload
npc.beforeOnload = function (data, img, npc)
{
Expand All @@ -59,5 +56,11 @@ export function updateNpcWithGameImage(npc, imgUrl)
beforeOnload.call(npc, ...arguments)
}
}
setTimeout(() => Engine.npcs.updateData([npc.d]), 1)
setTimeout(() =>
{
npc.d.icon = {
special: imgUrl
}
Engine.npcs.updateData([npc.d])
}, 1)
}

0 comments on commit 3cd79ab

Please sign in to comment.