From cca891ef93260e4ad7a1a0208ea0a94c70f685ba Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 15 Aug 2020 03:21:37 +0800 Subject: [PATCH] 1 --- webapp/controller/EquipController.class.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/webapp/controller/EquipController.class.php b/webapp/controller/EquipController.class.php index bd5688f..2f0f295 100644 --- a/webapp/controller/EquipController.class.php +++ b/webapp/controller/EquipController.class.php @@ -934,14 +934,23 @@ class EquipController{ } $arr2 = array(); $flag = 0; - for ($a = 0; $a < count($arr); $a++) { - $str = $arr[$a][0]; + $valexp = 0; + if ($lv == 0) { + $str = $arr[$lv][0]; $estr = explode(';', $str); - if ($estr[1][0] > $row['exp']) { - phpcommon\sendError(ERR_USER_BASE + 4, '未达到进阶需求'); - return; - } + $valexp = $estr[1]; + } else { + $str1 = $arr[$lv][0]; + $estr1 = explode(';', $str1); + $str = $arr[$lv - 1][0]; + $estr = explode(';', $str); + $valexp = $estr1[1] - $estr[1]; } + if ($valexp > $row['exp']) { + phpcommon\sendError(ERR_USER_BASE + 4, '未达到进阶需求'); + return; + } + if ($lv >= $e['max_level']) { phpcommon\sendError(ERR_USER_BASE + 5, '达到最大等级'); return;