Browse Source

修复开门的bug和服务器没有设置公告时候的bug

chelios 3 years ago
parent
commit
bc6ea17dc1
2 changed files with 6 additions and 3 deletions
  1. 4 2
      assets/Script/area/Tap_set_Ann.ts
  2. 2 1
      assets/Script/game/element/OpenDoor.ts

+ 4 - 2
assets/Script/area/Tap_set_Ann.ts

@@ -25,8 +25,10 @@ export default class Tap_set_Ann extends ViewObject {
             this.main.stopLoad();
             if(state == HttpStateType.SUCCESS){
                 let data = JSON.parse(reve.data)
-                this.mTitle.string = data.title;
-                this.mContent.string = data.content
+                if(data && data.title){
+                    this.mTitle.string = data.title;
+                    this.mContent.string = data.content
+                }
             }else{
                 this.main.showTips('网络异常');
             }

+ 2 - 1
assets/Script/game/element/OpenDoor.ts

@@ -44,8 +44,9 @@ export default class OpenDoor extends BaseEvent {
         let head = this.ff.mFFheader;
         let count = head.getTmpCount(this.goodID);
         if (count > 0) {
-            head.removeTmpGood(this.goodID, 1);
             this.showOpt(this.mTipsIcon,()=>{
+                head.removeTmpGood(this.goodID, 1);
+                this.closeOpt();
                 this.checkOpen();
             })
         }else{