This commit is contained in:
2025-12-08 17:49:30 +01:00
parent 2c446abbbb
commit 3096490a0c
8 changed files with 905 additions and 179 deletions

View File

@@ -88,9 +88,20 @@ class NPC {
if (this.scene.textures.exists(this.type)) {
texKey = this.type;
} else {
console.warn(`Texture for ${this.type} not found, generating fallback.`);
// Fallback generation triggers for known types if missing?
// We already generated them in TextureGenerator.generateAll()
console.warn(`Texture for ${this.type} not found, generating procedural...`);
// Generate procedural texture as fallback
if (this.type === 'cow' || this.type === 'cow_mutant') {
TextureGenerator.createCowSprite(this.scene, this.type, this.type.includes('mutant'));
} else if (this.type === 'chicken') {
TextureGenerator.createChickenSprite(this.scene, this.type, false);
} else if (this.type === 'troll') {
TextureGenerator.createTrollSprite(this.scene, this.type);
} else if (this.type === 'elf') {
TextureGenerator.createElfSprite(this.scene, this.type);
} else if (this.type === 'villager') {
TextureGenerator.createVillagerSprite(this.scene, this.type);
}
texKey = this.type; // Use type directly after generation
}
}