Kafa 153 Posted March 31, 2021 Share Posted March 31, 2021 Hey guys, i found a system released in owsap's github. I implemented it, but when i press the start button, my game crashes and my vdi says "Stackoverflow detected..." Here is the function bool CHARACTER::StartSlotMachine(uint8_t bBet) { if (!IsPC()) return false; if (!GetDesc()) return false; if (!CanWarp()) return false; if (!m_bSlotMachineOpen) return false; if (m_pkSlotMachineEvent) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[Slot Machine] The machine is already running.")); return false; } if (bBet > SlotMachineBetMap.size() || bBet < 1) bBet = 1; int64_t iPrice = SlotMachineBetMap[bBet]; if (GetGold() < iPrice) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[Slot Machine] You don't have enough money to bet.")); return false; } uint8_t iSlotMachineMltiplier = quest::CQuestManager::instance().GetEventFlag("slot_machine_multiplier"); if (iSlotMachineMltiplier > 0) bBet += iSlotMachineMltiplier; uint8_t iSlotMachineReels = quest::CQuestManager::instance().GetEventFlag("slot_machine_reels"); for (uint8_t bSlot = 0; bSlot < ESlotMachine::MAX_SLOT_MACHINE_SLOTS; ++bSlot) { std::random_device rd; std::mt19937 mt(rd()); std::uniform_real_distribution<> dist(1, (iSlotMachineReels > 0 ? iSlotMachineReels : ESlotMachine::MAX_SLOT_MACHINE_REELS)); m_bSlotMachineReel[bSlot] = static_cast<uint8_t>(dist(mt)); } Can someone help me? Link to comment Share on other sites More sharing options...
FBI 44 Posted March 31, 2021 Share Posted March 31, 2021 Check Owsap thread here and check idents: uint64_t = unsigned long long uint32_t = UINT int32_t = INT uint16_t = WORD uint8_t = BYTE PeriodWars Link to comment Share on other sites More sharing options...
Honorable Member Owsap 8153 Posted March 31, 2021 Honorable Member Share Posted March 31, 2021 Here, use int for the loop and you can also use the default number function to randomize the numbers. for (int bSlot = 0; bSlot < ESlotMachine::MAX_SLOT_MACHINE_SLOTS; ++bSlot) { m_bSlotMachineReel[bSlot] = number(1, (iSlotMachineReels > 0 ? iSlotMachineReels : ESlotMachine::MAX_SLOT_MACHINE_REELS)); } https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
Kafa 153 Posted April 2, 2021 Author Share Posted April 2, 2021 I changed all of the data types. Still core crash. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now