diff --git a/_incl_data/class/Insallah/Runes/Runes.php b/_incl_data/class/Insallah/Runes/Runes.php index 1f1a6407..2b42516c 100644 --- a/_incl_data/class/Insallah/Runes/Runes.php +++ b/_incl_data/class/Insallah/Runes/Runes.php @@ -70,16 +70,16 @@ class Runes /** Выкусывает руну из предмета. * - * @param array $itemData + * @param array $itemDataArray * data предмета * * @return array массив, item - предмет, rune - руна из предмета, rune_id - id руны. * Оба в подготовленном строчном формате для data */ - public static function removeRuneData($itemData) + public static function removeRuneData($itemDataArray) { # Ищем есть ли в предмете руна определённого типа. - $runeid = array_search('rune_id', array_flip($itemData)); + $runeid = array_search('rune_id', array_flip($itemDataArray)); if (!in_array($runeid, [6001, 6002, 6003])) { return []; } @@ -96,20 +96,24 @@ class Runes } $args = 0; //basic rune values - rune, id, name, lvl $rune = []; - foreach ($itemData as $key => $value) { + $item = []; + foreach ($itemDataArray as $key => $value) { if ($key == 'rune') { $args = 4 + $bonusArgs; } if ($args > 0) { $rune[$key] = $value; $args--; + continue; } + $item[$key] = $value; } - $runeData = urldecode('|' . http_build_query($rune, '', '|')); - $itemWithoutRuneData = str_replace($runeData, '', $itemData); + + unset($rune['rune'], $rune['rune_id'], $rune['rune_name'], $rune['rune_lvl']); + return [ - 'item' => (string)$itemWithoutRuneData, - 'rune' => $runeData, + 'item' => urldecode('|' . http_build_query($item, '', '|')), + 'rune' => urldecode('|' . http_build_query($rune, '', '|')), 'rune_id' => (int)$runeid ]; } diff --git a/modules_data/location/remont.php b/modules_data/location/remont.php index 29f49783..bc06ffc3 100644 --- a/modules_data/location/remont.php +++ b/modules_data/location/remont.php @@ -389,7 +389,7 @@ if($u->room['file']=='remont') $re = '