Skip to content

Commit 10f8731

Browse files
committed
fix: linux
1 parent 81da2a8 commit 10f8731

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/Modules/Engine.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,13 +1229,15 @@ void Engine::Shutdown() {
12291229
Interface::Delete(this->g_physCollision);
12301230

12311231
// Reset to the offsets that were originally in the code
1232+
if (this->readCustomDataInjectAddr && this->readConsoleCommandInjectAddr) {
12321233
#ifdef _WIN32
1233-
*(uint32_t *)this->readCustomDataInjectAddr = 0x50E8458D;
1234-
*(uint32_t *)this->readConsoleCommandInjectAddr = 0x000491E3;
1234+
*(uint32_t *)this->readCustomDataInjectAddr = 0x50E8458D;
1235+
*(uint32_t *)this->readConsoleCommandInjectAddr = 0x000491E3;
12351236
#else
1236-
*(uint32_t *)this->readCustomDataInjectAddr = 0x08244489;
1237-
*(uint32_t *)this->readConsoleCommandInjectAddr = 0x0008155A;
1237+
*(uint32_t *)this->readCustomDataInjectAddr = 0x08244489;
1238+
*(uint32_t *)this->readConsoleCommandInjectAddr = 0x0008155A;
12381239
#endif
1240+
}
12391241

12401242
#ifdef _WIN32
12411243
MH_UNHOOK(Engine::ParseSmoothingInfo_Mid);

src/Utils/SDK/CViewSetup.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,20 @@ void ViewSetupWrite(ViewSetup *view, T *cview) {
3232

3333
static ViewSetup *viewCtx = new ViewSetup;
3434
ViewSetup *ViewSetupCreate(CViewSetup *cview) {
35+
#ifdef _WIN32
3536
if (sar.game->Is(SourceGame_INFRA | SourceGame_BeginnersGuide | SourceGame_StanleyParable)) {
3637
ViewSetupRead(reinterpret_cast<CViewSetupINFRA *>(cview), viewCtx);
37-
} else {
38+
} else
39+
#endif
3840
ViewSetupRead(cview, viewCtx);
39-
}
4041
return viewCtx;
4142
}
4243

4344
void ViewSetupCopy(ViewSetup *view, CViewSetup *cview) {
45+
#ifdef _WIN32
4446
if (sar.game->Is(SourceGame_INFRA | SourceGame_BeginnersGuide | SourceGame_StanleyParable)) {
4547
ViewSetupWrite(view, reinterpret_cast<CViewSetupINFRA *>(cview));
46-
} else {
48+
} else
49+
#endif
4750
ViewSetupWrite(view, cview);
48-
}
4951
}

0 commit comments

Comments
 (0)