mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 09:35:39 -05:00
Added a property to prevent scripts from running after certain other scripts have run.
This commit is contained in:
parent
f4084ba5cc
commit
356d1b55ed
1 changed files with 6 additions and 0 deletions
|
@ -184,6 +184,11 @@ module.exports = class SpriteBoss extends CocoClass
|
|||
sprite.hasMoved = false
|
||||
@removeSprite sprite if missing
|
||||
@cache true if updateCache and @cached
|
||||
|
||||
# mainly for handling selecting thangs from session when the thang is not always in existence
|
||||
if @willSelectThang and @sprites[@willSelectThang[0]]
|
||||
@selectThang @willSelectThang...
|
||||
@willSelectThang = null
|
||||
|
||||
cache: (update=false) ->
|
||||
return if @cached and not update
|
||||
|
@ -241,6 +246,7 @@ module.exports = class SpriteBoss extends CocoClass
|
|||
@selectSprite e if e.onBackground
|
||||
|
||||
selectThang: (thangID, spellName=null) ->
|
||||
return @willSelectThang = [thangID, spellName] unless @sprites[thangID]
|
||||
@selectSprite null, @sprites[thangID], spellName
|
||||
|
||||
selectSprite: (e, sprite=null, spellName=null) ->
|
||||
|
|
Loading…
Reference in a new issue