Skip to content

Commit 0e7b68d

Browse files
committed
Fixed unloading
1 parent 518bb6d commit 0e7b68d

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

AuroraGSI-RL/AuroraGSI.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@ void AuroraGSI::onLoad()
1313
void AuroraGSI::onUnload()
1414
{
1515
ok = false;
16-
cvarManager->log("false");
1716
}
1817
#pragma endregion
1918

2019
#pragma region Aurora
2120
void AuroraGSI::StartLoop() {
22-
while (ok) {
21+
if (ok) {
2322
gameWrapper->Execute(std::bind(&AuroraGSI::UpdateMatchState, this));
2423
string newJson = GameState.GetJson().dump();
2524
if (Json != newJson) {
2625
Json = newJson;
2726
SendToAurora(newJson);
2827
}
29-
Sleep(100);
28+
this->gameWrapper->SetTimeout(std::bind(&AuroraGSI::StartLoop, this), 0.100);
3029
}
31-
cvarManager->log("stop");
3230
}
3331

3432
void AuroraGSI::SendToAurora(std::string data)

AuroraGSI-RL/AuroraGSI.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class AuroraGSI : public BakkesMod::Plugin::BakkesModPlugin
1414
GameStateNode GameState;
1515
std::string Json;
1616
bool ok = true;
17+
bool stopped = false;
1718
#pragma endregion
1819

1920
#pragma region Aurora

0 commit comments

Comments
 (0)