diff --git a/game/game.js b/game/game.js index 2c91c5b2c..d9ede4c08 100644 --- a/game/game.js +++ b/game/game.js @@ -24816,8 +24816,12 @@ getStorage:function(name){ return this.storage[name]||[]; }, - hasStorage:function(name){ - return name in this.storage; + hasStorage:function(name,value){ + if(!(name in this.storage)) return false; + if(typeof value=="undefined") return true; + const storage=this.storage[name]; + if(storage===value) return true; + return !Array.isArray(storage) || storage.contains(value); }, initStorage:function(name,value){ return this.hasStorage(name)?this.getStorage(name):this.setStorage(name,value); @@ -24830,6 +24834,9 @@ .then(value=>operation(value)) .then(value=>this.setStorage(name,value)) }, + removeStorage:function(name){ + return player.hasStorage(name)&&delete player.storage[name]; + }, markSkill:function(name,info,card){ if(info===true){ this.syncStorage(name);