From 3f9b507eedadaa4961837cc85982b4a9fdc1b9b3 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sat, 25 Nov 2017 10:11:37 +0100 Subject: [PATCH] Update: CC - Before Render - Moorcow (a2ow5l92js.js) 74 bytes modified --- a2ow5l92js.js | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/a2ow5l92js.js b/a2ow5l92js.js index d4a0a3a..419aa0a 100644 --- a/a2ow5l92js.js +++ b/a2ow5l92js.js @@ -15,6 +15,27 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } ); + if (this.blastSubscription) { + this.blastSubscription.remove(); + } + + this.blastSubscription = GameLib.Event.Subscribe( + GameLib.Event.AUDIO_ENDED, + function(data) { + if (data.audio.name === name) { + var play = GameLib.Utils.GetRandomIntInclusive(1,5); + if (play === 1) { + GameLib.Event.Emit( + GameLib.Event.PLAY_AUDIO, + { + name : 'Audio - Ho ho ho' + } + ); + } + } + }.bind(this) + ); + this.fog = this.entityLoaded.fog; this.bull = this.entityLoaded.bull; this.star = this.entityLoaded.star; @@ -397,34 +418,6 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { name = 'Audio - Blast 3'; } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, - function(data) { - - if (data.audio.name === name) { - - if (this.blastSubscription) { - - this.blastSubscription.remove(); - - this.blastSubscription = null; - - var play = GameLib.Utils.GetRandomIntInclusive(1,3); - - if (play === 1) { - - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, - { - name : 'Audio - Ho ho ho' - } - ); - } - } - } - }.bind(this) - ); - GameLib.Event.Emit( GameLib.Event.PLAY_AUDIO, {