diff --git a/src/convar.cc b/src/convar.cc index bf561c7..ea74836 100644 --- a/src/convar.cc +++ b/src/convar.cc @@ -291,10 +291,11 @@ void ConvarBase::tf_convar_changed(sdk::IConVar *iconvar, const char *old_string ConvarBase::ConvarBase(const char *name, ConvarType type, const ConvarBase *parent) : parent(parent), t(type), next(head), init_complete(false) { head = this; - if constexpr (doghook_platform_windows()) - strcpy_s(internal_name, name); - else if constexpr (doghook_platform_linux()) - strcpy(internal_name, name); +#if doghook_platform_windows() + strcpy_s(internal_name, name); +#elif doghook_platform_linux() + strcpy(internal_name, name); +#endif // Create a tf convar based on this one tf_convar = new sdk::ConCommandBase; diff --git a/src/convar.hh b/src/convar.hh index f1f9d4c..c9be2b4 100644 --- a/src/convar.hh +++ b/src/convar.hh @@ -300,7 +300,12 @@ public: auto size = strlen(str) + 1; value = new char[size]; + +#if doghook_platform_windows() strcpy_s(this->value, size, str); +#elif doghook_platform_linux() + strncpy(this->value, size, str); +#endif return false; } diff --git a/src/sdk.hh b/src/sdk.hh index eb0e50d..6fe726b 100644 --- a/src/sdk.hh +++ b/src/sdk.hh @@ -239,6 +239,7 @@ public: auto get_verified_user_cmd(u32 sequence_number) -> class VerifiedCmd * { // 03 B7 ? ? ? ? 8D 04 88 + return nullptr; } };