Bladeren bron

debug optional goods acting time

stanley-king 7 jaren geleden
bovenliggende
commit
051f65dfc6
1 gewijzigde bestanden met toevoegingen van 13 en 5 verwijderingen
  1. 13 5
      helper/activity/optional_goods.php

+ 13 - 5
helper/activity/optional_goods.php

@@ -73,6 +73,8 @@ class opgroup
 
     public function info($gid)
     {
+        if($this->acting() == false) return false;
+
         if(algorithm::binary_search($this->mGoods,$gid))
         {
             $result['special_id'] = $this->mSpecialID;
@@ -179,10 +181,16 @@ class optional_goods
         $gid = intval($goods_id);
         if ($gid <= 0) return false;
 
-        if (algorithm::binary_search($this->mAllGoods, $gid)) {
-            foreach ($this->mOpgroups as $group) {
+        if (algorithm::binary_search($this->mAllGoods, $gid))
+        {
+            foreach ($this->mOpgroups as $group)
+            {
                 $info = $group->info($gid);
-                if ($info != false) {
+                if($info == false) continue;
+
+                if($group->acting() == false) {
+                    return false;
+                } else {
                     return $info;
                 }
             }
@@ -201,9 +209,9 @@ class optional_goods
         $match_goods = $this->sel_goods($match_goods, $gidnums);
 
         $result = [];
-        foreach ($this->mOpgroups as $opgroup) {
+        foreach ($this->mOpgroups as $opgroup)
+        {
             if (empty($match_goods)) break;
-
             $part = $opgroup->match($match_goods);
             if ($part != false) {
                 $result[] = $part;