Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable spt_con_notify for Steampipe - causing weird crashses #357

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions spt/features/con_notify.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "stdafx.hpp"
#include "game_detection.hpp"
#include "..\feature.hpp"
#include "visualizations\imgui\imgui_interface.hpp"

Expand Down Expand Up @@ -49,7 +50,14 @@ static ConNotifyFeature spt_con_notify;

bool ConNotifyFeature::ShouldLoadFeature()
{
return true;
if (utils::DoesGameLookLikeSteampipe())
{
return false;
}
else
{
return true;
}
}

void ConNotifyFeature::InitHooks()
Expand Down Expand Up @@ -83,15 +91,12 @@ void ConNotifyFeature::LoadFeature()
return;\
} \
\
const char* devVal = developer->GetString(); \
char* oldDev = new char[strlen(devVal) + 1]; \
strcpy(oldDev, devVal); \
auto oldDev = developer->GetFloat(); \
developer->SetValue(true); \
\
spt_con_notify.ORIG_##funcName(__VA_ARGS__); \
\
developer->SetValue(oldDev); \
delete[] oldDev; \
return;\
}

Expand Down
9 changes: 9 additions & 0 deletions spt/utils/game_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ namespace utils
return result;
}

bool DoesGameLookLikeSteampipe()
{
#ifdef SSDK2013
return true;
#else
return false;
#endif
}

bool DoesGameLookLikeEstranged()
{
static bool cached = false, result = false;
Expand Down
1 change: 1 addition & 0 deletions spt/utils/game_detection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace utils
bool DoesGameLookLikeBMSRetail();
bool DoesGameLookLikeBMSLatest();
bool DoesGameLookLikeBMSMod();
bool DoesGameLookLikeSteampipe();
bool DoesGameLookLikeEstranged();
int DateToBuildNumber(const char* date_str);
int GetBuildNumber();
Expand Down