forked from noxious/server
Removed check that prevented overwriting existing spritesheets
This commit is contained in:
parent
b520acc2db
commit
ce90d6f7a9
@ -83,21 +83,8 @@ export default class SpriteUpdateEvent {
|
||||
include: { spriteActions: true }
|
||||
})
|
||||
|
||||
// Process only actions with changed sprites
|
||||
// Process sprites
|
||||
const processedActions = await Promise.all(parsedActions.map(async (action) => {
|
||||
const existing = existingSprite?.spriteActions.find(sa => sa.action === action.action)
|
||||
|
||||
// If sprites array matches existing, return existing data
|
||||
if (existing && JSON.stringify(existing.sprites) === JSON.stringify(action.sprites)) {
|
||||
return {
|
||||
...action,
|
||||
frameWidth: existing.frameWidth,
|
||||
frameHeight: existing.frameHeight,
|
||||
buffersWithDimensions: [] // No need to process frames
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise process the new sprites
|
||||
const spriteBuffers = await this.convertBase64ToBuffers(action.sprites)
|
||||
const frameWidth = ISOMETRIC_CONFIG.tileWidth
|
||||
const frameHeight = await this.calculateOptimalHeight(spriteBuffers)
|
||||
|
Loading…
x
Reference in New Issue
Block a user