From fb4ab9e5c87f8989cbba35976f92fefb9933e814 Mon Sep 17 00:00:00 2001 From: yangduo Date: Mon, 14 Apr 2025 16:48:55 +0800 Subject: [PATCH] adjust --- webapp/controller/RoleController.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index 22c0d04..9749cfd 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -464,9 +464,12 @@ class RoleController $p1 = $this->getParameter(INITIAL_WEAPON); $weapons = explode('|', $p1['param_value']); $addreward = new classes\AddReward(); - foreach($weapons as $itemid) { - $addreward->addReward($itemid, 1, $account_id, 0, 0); - } + foreach ($weapons as $itemstr) { + $strs = explode(':', $itemstr); + $itemid = $strs[0]; + $itemnum = count($strs) > 1 ? $strs[1] : 1; + $addreward->addReward($itemid, $itemnum, $account_id, 0, 0); + } } } }