Added changes to outside code.

This commit is contained in:
Caball
2024-12-31 00:30:58 +01:00
parent d424dc2c45
commit d76f41deb9
5 changed files with 27 additions and 0 deletions
+7
View File
@@ -5,6 +5,7 @@
#include "game/dvars.hpp"
#include "console.hpp"
#include "demo_playback.hpp"
#include <utils/hook.hpp>
#include <utils/string.hpp>
@@ -13,6 +14,12 @@ namespace dvar_cheats
{
void apply_sv_cheats(const game::dvar_t* dvar, const game::DvarSetSource source, game::dvar_value* value)
{
// return early because sv_cheats is enabled when playing back demos
if (demo_playback::playing())
{
return;
}
if (dvar && dvar->name == "sv_cheats"s)
{
// if dedi, do not allow internal to change value so servers can allow cheats if they want to