26 bool prevButton = m_flags.
onBit(eFlags::ItemButtonHold);
27 m_flags.
resetBit(eFlags::ItemButtonHold, eFlags::ItemButtonActivation);
29 const auto ¤tInputs = inputs()->currentState();
30 if (currentInputs.item()) {
31 m_flags.
setBit(eFlags::ItemButtonHold).
changeBit(!prevButton, eFlags::ItemButtonActivation);
34 if (m_flags.
onBit(eFlags::Lockout)) {
35 if (!state()->isBeforeRespawn() && !state()->isInAction() && !state()->isTriggerRespawn() &&
36 !state()->isCannonStart() && !state()->isInCannon() && !state()->isAfterCannon()) {
40 if (state()->isInRespawn() || state()->isInAction() || state()->isTriggerRespawn() ||
41 state()->isCannonStart() || state()->isInCannon()) {
42 m_flags.
setBit(eFlags::Lockout);
44 const auto *raceMgr = System::RaceManager::Instance();
45 bool canUse = m_flags.
onBit(eFlags::ItemButtonActivation);
46 canUse = canUse && raceMgr->isStageReached(System::RaceManager::Stage::Race);
47 canUse = canUse && !state()->isInAction();
48 canUse = canUse && !state()->isBurnout();
49 canUse = canUse && (m_inventory.id() != ItemId::NONE);