Skip to content

Commit

Permalink
Pre fill last used nade array
Browse files Browse the repository at this point in the history
there is no fillup on pickup so prefill array by priority
  • Loading branch information
solcloud committed Sep 26, 2023
1 parent df02984 commit 8f5924f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions server/src/Core/Inventory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Inventory
private int $dollars = 0;
private int $equippedSlot;
private int $lastEquippedSlotId;
/** @var int[] */
private array $lastEquippedGrenadeSlots = [];
/** @var int[] [slotId] */
private array $lastEquippedGrenadeSlots;
private BuyMenu $store;

public function __construct(bool $isAttackerSide)
Expand All @@ -39,7 +39,10 @@ public function reset(bool $isAttackerSide, bool $respawn): void
];
$this->equippedSlot = InventorySlot::SLOT_SECONDARY->value;
$this->lastEquippedSlotId = InventorySlot::SLOT_KNIFE->value;
$this->lastEquippedGrenadeSlots = [];
$this->lastEquippedGrenadeSlots = [
InventorySlot::SLOT_GRENADE_SMOKE->value, InventorySlot::SLOT_GRENADE_MOLOTOV->value, InventorySlot::SLOT_GRENADE_HE->value,
InventorySlot::SLOT_GRENADE_FLASH->value, InventorySlot::SLOT_GRENADE_DECOY->value,
];
} else {
foreach ($this->items as $item) {
$item->reset();
Expand Down

0 comments on commit 8f5924f

Please sign in to comment.