Эх сурвалжийг харах

Rune efficiencies calculated on profile import.

Iñigo Valentin 5 жил өмнө
parent
commit
f2b98281d3

+ 1 - 1
application/API/v3/profile/PUT.php

@@ -353,7 +353,7 @@
         }
 
         // Instantiate and calculate efficiency:
-        $instance = new Rune($ruine->{"rune_id");
+        $instance = new Rune($rune->{"rune_id"});
         
 
         // Assigned?

+ 3 - 3
application/entity/Rune.php

@@ -201,13 +201,13 @@
                 }
                 $this->quality_name = $this->get_quality_name($this->quality);
                 $this->original_quality_name = $this->get_quality_name($this->original_quality);
-                if ($this->efficiency == null){
+                if ($this->efficiency == null || $this->efficiency == "" || intval($this->efficiency) == 0){
                     $this->efficiency = $this->calculate_efficiency();
                     $this->max_efficiency = $this->calculate_maximum_efficiency();
                     $statement = $db->prepare("
                       UPDATE rune
                       SET
-                        efficiency = :eficiency,
+                        efficiency = :efficiency,
                         max_efficiency = :max_efficiency
                       WHERE id = :rune
                     ");
@@ -323,7 +323,7 @@
                 }
             }
             for ($i = 1; $i <= 4; $i ++){
-                if ($this->stats[$i] != null && $this->stats[$i]->value > 0){
+                if (sizeof($this->stats) > $i && $this->stats[$i] != null && $this->stats[$i]->value > 0){
                     $value = $this->stats[$i]->value;
                     $value = $this->stats[$i]->value;
                     $statement = $db->prepare($query);