Skip to content

Commit 4191c61

Browse files
committed
feat: cleaning game, divinity support
Fixes #334
1 parent f6617e6 commit 4191c61

7 files changed

Lines changed: 16 additions & 6 deletions

File tree

src/Game.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,25 @@ Game *Game::CreateNew() {
6262
return modDir;
6363
};
6464

65-
auto modDir = GetModDir(TARGET_MOD2);
65+
auto engineDir = GetModDir(TARGET_MOD2);
6666

6767
// This check is at the top because aptag's server dll is in a
6868
// portal2 bin folder so it gets detected as portal 2 otherwise
69-
if (Utils::ICompare(modDir, ApertureTag::GameDir())) {
69+
if (Utils::ICompare(engineDir, ApertureTag::GameDir())) {
7070
return new ApertureTag();
7171
}
7272

7373
// May as well do the same thing here too then
74-
if (Utils::ICompare(modDir, ThinkingWithTimeMachine::GameDir())) {
74+
if (Utils::ICompare(engineDir, ThinkingWithTimeMachine::GameDir())) {
7575
return new ThinkingWithTimeMachine();
7676
}
7777

78-
modDir = GetModDir(TARGET_MOD);
78+
auto modDir = GetModDir(TARGET_MOD);
7979

80-
if (Utils::ICompare(modDir, Portal2::ModDir())) {
81-
80+
if (Utils::ICompare(modDir, Portal2::ModDir()) ||
81+
Utils::ICompare(modDir, "cleaninggame") ||
82+
Utils::ICompare(modDir, "divinity")) {
83+
// Technically The Cleaning Game is on 8928 but all sigs match 9568
8284
void *engineClient = Interface::GetPtr(MODULE("engine"), "VEngineClient015");
8385
if (engineClient) {
8486
return new Portal2();
@@ -107,6 +109,8 @@ Game *Game::CreateNew() {
107109
return new StanleyParable();
108110
}
109111

112+
console->Warning("Unknown game (server \"%s\" engine \"%s\")\n", modDir.c_str(), engineDir.c_str());
113+
110114
return nullptr;
111115
}
112116
std::string Game::VersionToString(int version) {

src/Offsets/Beginners Guide 6167.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "Offsets/Portal 2 7054.hpp"
2+
// Beginner's Guide
23

34
// CClientState
45
OFFSET_DEFAULT(viewangles, 19112, 19084)

src/Offsets/INFRA 6905.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "Offsets/Portal 2 7054.hpp"
2+
// INFRA
23

34
// CEngineClient
45
OFFSET_WINDOWS(GetActiveSplitScreenPlayerSlot, 129)

src/Offsets/Portal 2 5723.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "Offsets/Portal 2 7054.hpp"
2+
// Thinking With Time Machine
23

34
OFFSET_DEFAULT(RemoveMaterial, 156, 157)
45

src/Offsets/Portal 2 7054.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "Offsets/Portal 2 8151.hpp"
2+
// Aperture Tag
23

34
// FIXME: OnGameOverlayActivated
45

src/Offsets/Portal 2 8151.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "Offsets/Portal 2 9568.hpp"
2+
// Portal Stories: Mel, Reloaded
23

34
OFFSET_LINUX(tickcount, 74)
45
OFFSET_LINUX(interval_per_tick, 82)

src/Offsets/Portal 2 9568.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# pragma GCC diagnostic push
33
# pragma GCC diagnostic ignored "-Wunused-variable"
44
#endif
5+
// Portal 2 Steam, sourcemods, The Cleaning Game, Divinity
56

67

78
// Interface

0 commit comments

Comments
 (0)