|
9 | 9 | use App\Flare\Models\SetSlot; |
10 | 10 | use App\Game\Character\Builders\AttackBuilders\Handler\UpdateCharacterAttackTypesHandler; |
11 | 11 | use App\Game\Character\CharacterInventory\Validations\SetHandsValidation; |
| 12 | +use App\Game\Character\CharacterInventory\Values\ItemType; |
12 | 13 | use App\Game\Core\Events\UpdateCharacterInventoryCountEvent; |
13 | 14 | use App\Game\Core\Events\UpdateTopBarEvent; |
14 | 15 | use App\Game\Core\Traits\ResponseBuilder; |
@@ -313,7 +314,7 @@ public function equipInventorySet(Character $character, InventorySet $inventoryS |
313 | 314 | $armourPositions = ['body', 'leggings', 'feet', 'sleeves', 'sleeves', 'helmet', 'gloves']; |
314 | 315 |
|
315 | 316 | foreach ($inventorySet->slots as $slot) { |
316 | | - if ($slot->item->type === 'weapon') { |
| 317 | + if (in_array($slot->item->type, ItemType::validWeapons())) { |
317 | 318 | $data = $this->setPositionEquipData($slot, $data, 'left-hand', 'right-hand'); |
318 | 319 | } |
319 | 320 |
|
@@ -346,8 +347,10 @@ public function equipInventorySet(Character $character, InventorySet $inventoryS |
346 | 347 | } |
347 | 348 | } |
348 | 349 |
|
349 | | - foreach ($data as $slotId => $data) { |
350 | | - $inventorySet->slots()->find($slotId)->update($data); |
| 350 | + dump('Whats the data?', $data); |
| 351 | + |
| 352 | + foreach ($data as $slotId => $slotData) { |
| 353 | + $inventorySet->slots()->find($slotId)->update($slotData); |
351 | 354 | } |
352 | 355 |
|
353 | 356 | $inventorySet->update(['is_equipped' => true]); |
|
0 commit comments