From 25d676545255d1f7a6814b869655ece61bcf87b5 Mon Sep 17 00:00:00 2001 From: WlodekM Date: Sun, 26 Jan 2025 13:41:50 +0200 Subject: wip rewrite to use override option in settings --- src/EntityComponents.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'src/EntityComponents.c') diff --git a/src/EntityComponents.c b/src/EntityComponents.c index 3cde107..9652a71 100644 --- a/src/EntityComponents.c +++ b/src/EntityComponents.c @@ -13,6 +13,7 @@ #include "Physics.h" #include "Model.h" #include "Audio.h" +#include "Options.h" /*########################################################################################################################* *----------------------------------------------------AnimatedComponent----------------------------------------------------* @@ -228,18 +229,31 @@ void HacksComp_RecheckFlags(struct HacksComp* hacks) { HacksComp_SetAll(hacks, hax); hacks->CanBePushed = true; - HacksComp_ParseFlag(hacks, "+fly", "-fly", &hacks->CanFly); - HacksComp_ParseFlag(hacks, "+noclip", "-noclip", &hacks->CanNoclip); - HacksComp_ParseFlag(hacks, "+speed", "-speed", &hacks->CanSpeed); - HacksComp_ParseFlag(hacks, "+respawn", "-respawn", &hacks->CanRespawn); - HacksComp_ParseFlag(hacks, "+push", "-push", &hacks->CanBePushed); - HacksComp_ParseFlag(hacks, "+thirdperson", "-thirdperson", &hacks->CanUseThirdPerson); - HacksComp_ParseFlag(hacks, "+names", "-names", &hacks->CanSeeAllNames); + if(Options_GetBool(OPT_HACKS_OVERRIDE, true)) { + Platform_Log("Overriding cheats", 18); + hacks->CanFly = true; + hacks->CanNoclip = true; + hacks->CanSpeed = true; + hacks->CanRespawn = true; + hacks->CanBePushed = true; + hacks->CanUseThirdPerson = true; + hacks->CanSeeAllNames = true; + } else { + Platform_Log("Not overriding cheats", 22); + HacksComp_ParseFlag(hacks, "+fly", "-fly", &hacks->CanFly); + HacksComp_ParseFlag(hacks, "+noclip", "-noclip", &hacks->CanNoclip); + HacksComp_ParseFlag(hacks, "+speed", "-speed", &hacks->CanSpeed); + HacksComp_ParseFlag(hacks, "+respawn", "-respawn", &hacks->CanRespawn); + HacksComp_ParseFlag(hacks, "+push", "-push", &hacks->CanBePushed); + HacksComp_ParseFlag(hacks, "+thirdperson", "-thirdperson", &hacks->CanUseThirdPerson); + HacksComp_ParseFlag(hacks, "+names", "-names", &hacks->CanSeeAllNames); + if (hacks->IsOp) HacksComp_ParseAllFlag(hacks, "+ophax", "-ophax"); + } - if (hacks->IsOp) HacksComp_ParseAllFlag(hacks, "+ophax", "-ophax"); hacks->BaseHorSpeed = HacksComp_ParseFlagFloat("horspeed=", hacks); hacks->MaxHorSpeed = HacksComp_ParseFlagFloat("maxspeed=", hacks); - hacks->MaxJumps = HacksComp_ParseFlagInt("jumps=", hacks) + 2; + //TODO - WL - add jump ammount to hax settings + hacks->MaxJumps = HacksComp_ParseFlagInt("jumps=", hacks); HacksComp_Update(hacks); } -- cgit 1.4.1-2-gfad0