From 72b983b7dba1f61b2b016359796c857ef3f1902d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 16 Oct 2024 17:00:35 +0800 Subject: [PATCH] 1 --- webapp/controller/BattleController.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index dfed480d..a74a5296 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -1019,6 +1019,11 @@ class BattleController extends BaseAuthedController { public function useBattleItem() { $itemId = getReqVal('item_id', 0); + $itemMeta = mt\Item::get($itemId); + if (!$itemMeta) { + $this->_rspErr(2, 'config error'); + return; + } $itemCount = Bag::getItemCount($itemId); if ($itemCount > 0) { Bag::decItem($itemId, 1);