Skip to content

Commit be90073

Browse files
committed
Fixed equipping sets with new item types
1 parent bf476b9 commit be90073

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/Game/Character/CharacterInventory/Services/InventorySetService.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use App\Flare\Models\SetSlot;
1010
use App\Game\Character\Builders\AttackBuilders\Handler\UpdateCharacterAttackTypesHandler;
1111
use App\Game\Character\CharacterInventory\Validations\SetHandsValidation;
12+
use App\Game\Character\CharacterInventory\Values\ItemType;
1213
use App\Game\Core\Events\UpdateCharacterInventoryCountEvent;
1314
use App\Game\Core\Events\UpdateTopBarEvent;
1415
use App\Game\Core\Traits\ResponseBuilder;
@@ -313,7 +314,7 @@ public function equipInventorySet(Character $character, InventorySet $inventoryS
313314
$armourPositions = ['body', 'leggings', 'feet', 'sleeves', 'sleeves', 'helmet', 'gloves'];
314315

315316
foreach ($inventorySet->slots as $slot) {
316-
if ($slot->item->type === 'weapon') {
317+
if (in_array($slot->item->type, ItemType::validWeapons())) {
317318
$data = $this->setPositionEquipData($slot, $data, 'left-hand', 'right-hand');
318319
}
319320

@@ -346,8 +347,10 @@ public function equipInventorySet(Character $character, InventorySet $inventoryS
346347
}
347348
}
348349

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);
351354
}
352355

353356
$inventorySet->update(['is_equipped' => true]);

0 commit comments

Comments
 (0)