diff options
author | WlodekM <[email protected]> | 2025-01-26 13:41:50 +0200 |
---|---|---|
committer | WlodekM <[email protected]> | 2025-01-26 13:41:50 +0200 |
commit | 25d676545255d1f7a6814b869655ece61bcf87b5 (patch) | |
tree | 8ad1aca3766637478926f45f64d6d1b714fdafa0 /src/Entity.c | |
parent | b359faa5b925f147886d1183e78a88aa893308c6 (diff) |
wip rewrite to use override option in settings
Diffstat (limited to 'src/Entity.c')
-rw-r--r-- | src/Entity.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Entity.c b/src/Entity.c index b400c85..79a8afd 100644 --- a/src/Entity.c +++ b/src/Entity.c @@ -763,6 +763,7 @@ static void LocalPlayer_Init(struct LocalPlayer* p, int index) { hacks->NoclipSlide = Options_GetBool(OPT_NOCLIP_SLIDE, false); hacks->WOMStyleHacks = Options_GetBool(OPT_WOM_STYLE_HACKS, false); hacks->FullBlockStep = Options_GetBool(OPT_FULL_BLOCK_STEP, false); + hacks->Override = Options_GetBool(OPT_HACKS_OVERRIDE, true); p->Physics.UserJumpVel = Options_GetFloat(OPT_JUMP_VELOCITY, 0.0f, 52.0f, 0.42f); p->Physics.JumpVel = p->Physics.UserJumpVel; hackPermMsgs = Options_GetBool(OPT_HACK_PERM_MSGS, true); @@ -822,7 +823,7 @@ static void LocalPlayer_DoRespawn(struct LocalPlayer* p) { /* Spawn player at highest solid position to match vanilla Minecraft classic */ /* Only when player can noclip, since this can let you 'clip' to above solid blocks */ - if (true) { // p->Hacks.CanNoclip // + if (p->Hacks.CanNoclip) { // WL - reverted // AABB_Make(&bb, &spawn, &p->Base.Size); for (y = pos.y; y <= World.Height; y++) { spawnY = Respawn_HighestSolidY(&bb); @@ -856,7 +857,7 @@ static void LocalPlayer_DoRespawn(struct LocalPlayer* p) { static cc_bool LocalPlayer_HandleRespawn(int key) { struct LocalPlayer* p = Entities.CurPlayer; - if (true) { // p->Hacks.CanRespawn // + if (p->Hacks.CanRespawn) { // WL - reverted // LocalPlayer_DoRespawn(p); return true; } else if (!p->_warnedRespawn) { @@ -868,15 +869,15 @@ static cc_bool LocalPlayer_HandleRespawn(int key) { static cc_bool LocalPlayer_HandleSetSpawn(int key) { struct LocalPlayer* p = Entities.CurPlayer; - if (true) { // p->Hacks.CanRespawn // + if (p->Hacks.CanRespawn) { // WL - reverted // - if (!true && !p->Base.OnGround) { // p->Hacks.CanNoclip // + if (!p->Hacks.CanNoclip && !p->Base.OnGround) { // WL - reverted // Chat_AddRaw("&cCannot set spawn midair when noclip is disabled"); return false; } /* Spawn is normally centered to match vanilla Minecraft classic */ - if (!true) { // p->Hacks.CanNoclip // + if (!p->Hacks.CanNoclip) { // WL - reverted // /* Don't want to use Position because it is interpolated between prev and next. */ /* This means it can be halfway between stepping up a stair and clip through the floor. */ p->Spawn = p->Base.prev.pos; @@ -895,7 +896,7 @@ static cc_bool LocalPlayer_HandleSetSpawn(int key) { static cc_bool LocalPlayer_HandleFly(int key) { struct LocalPlayer* p = Entities.CurPlayer; - if (true && p->Hacks.Enabled) { // p->Hacks.CanFly // + if (p->Hacks.CanFly && p->Hacks.Enabled) { // WL - reverted // HacksComp_SetFlying(&p->Hacks, !p->Hacks.Flying); return true; } else if (!p->_warnedFly) { @@ -908,7 +909,7 @@ static cc_bool LocalPlayer_HandleFly(int key) { static cc_bool LocalPlayer_HandleNoclip(int key) { struct LocalPlayer* p = Entities.CurPlayer; - if (true && p->Hacks.Enabled) { // p->Hacks.CanNoclip // + if (p->Hacks.CanNoclip && p->Hacks.Enabled) { // WL - reverted // if (p->Hacks.WOMStyleHacks) return true; /* don't handle this here */ if (p->Hacks.Noclip) p->Base.Velocity.y = 0; @@ -976,7 +977,7 @@ static void LocalPlayer_HookBinds(void) { } cc_bool LocalPlayer_CheckCanZoom(struct LocalPlayer* p) { - if (true) return true; // p->Hacks.CanFly // + if (p->Hacks.CanFly) return true; // WL - reverted // if (!p->_warnedZoom) { p->_warnedZoom = true; |