diff --git a/src/systems/MasterWeatherSystem.js b/src/systems/MasterWeatherSystem.js index 66345268d..a65fae97c 100644 --- a/src/systems/MasterWeatherSystem.js +++ b/src/systems/MasterWeatherSystem.js @@ -455,12 +455,13 @@ export default class MasterWeatherSystem { } // Update rain/snow particle positions based on wind - if (this.rainEmitter.active) { + // ✅ NULL CHECK: Ensure emitter exists and has setSpeedX method + if (this.rainEmitter && this.rainEmitter.active && typeof this.rainEmitter.setSpeedX === 'function') { const windInfluence = this.windSystem.wind.strength * 20; this.rainEmitter.setSpeedX({ min: -windInfluence, max: windInfluence }); } - if (this.snowEmitter.active) { + if (this.snowEmitter && this.snowEmitter.active && typeof this.snowEmitter.setSpeedX === 'function') { const windInfluence = this.windSystem.wind.strength * 30; this.snowEmitter.setSpeedX({ min: -windInfluence, max: windInfluence }); }