Skip to content

Commit

Permalink
Got the basis of the prototype in place, a quick re-write will get it…
Browse files Browse the repository at this point in the history
… working.
  • Loading branch information
AdamKyle committed Nov 27, 2023
1 parent b0fc733 commit 2cc1af4
Show file tree
Hide file tree
Showing 6 changed files with 201 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public function equipBestInSlot(Character $character, EquipBestItemForSlotsTypes

$this->updateCharacterAttackDataCache($character);

$characterInventoryService = $this->characterInventoryService->setCharacter($character);
$characterInventoryService = $this->characterInventoryService->setCharacter($character->refresh());

$message = $changedEquipment ? 'Equipped or Replaced equipped items with the best in slot items!' : 'You currently have the best items equipped!';

Expand Down Expand Up @@ -561,11 +561,11 @@ public function unequipItem(Request $request, Character $character, InventorySet
'position' => null,
]);

event(new UpdateTopBarEvent($character->refresh()));
$character = $character->refresh();

$this->updateCharacterAttackDataCache($character);

$character = $character->refresh();
event(new UpdateTopBarEvent($character->refresh()));

$inventory = $this->characterInventoryService->setCharacter($character);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ public function findCharacterInventorySlotIds(): array {
/**
* Fetch equipped items.
*
* @return array|null
* @return array
*/
public function fetchEquipped(): array|null {
public function fetchEquipped(): array {

$inventory = Inventory::where('character_id', $this->character->id)->first();

Expand All @@ -447,7 +447,7 @@ public function fetchEquipped(): array|null {
$inventorySet = InventorySet::where('character_id', $this->character->id)->where('is_equipped', true)->first();

if (is_null($inventorySet)) {
return null;
return [];
}

$this->isInventorySetIsEquipped = true;
Expand Down
Loading

0 comments on commit 2cc1af4

Please sign in to comment.