From aaceab72304987211494ddd1a90989f2da4cbd59 Mon Sep 17 00:00:00 2001 From: syzzi Date: Sat, 22 Jun 2024 04:55:19 +0200 Subject: [PATCH] fix platformer again............ --- changelog.md | 4 ++++ src/main.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 4585b5b..d3f5b07 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +# v1.1.15 + +* fix platformer again cuz im the troller of the century + # v1.1.14 * Fix platformer because I accidentally broke it in v1.1.13 diff --git a/src/main.cpp b/src/main.cpp index adc51e7..cc7e1df 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -52,8 +52,8 @@ const step emptyStep = step{ emptyInput, 1.0, true }; std::queue inputQueue; -std::set inputBinds[6]; -std::set heldInputs; +std::unordered_set inputBinds[6]; +std::unordered_set heldInputs; CRITICAL_SECTION inputQueueLock; CRITICAL_SECTION keybindsLock; @@ -465,7 +465,7 @@ class $modify(PlayerObject) { pl->checkCollisions(this, newTimeFactor, true); PlayerObject::updateRotation(newTimeFactor); } - else if (isPlatformer && !firstLoop) { // checking collision extra times in platformer breaks moving platforms so this is a scuffed temporary fix + else if (isPlatformer && step.deltaFactor != 1.0) { // checking collision extra times in platformer breaks moving platforms so this is a scuffed temporary fix if (firstLoop) this->m_isOnGround = p1StartedOnGround; else this->m_isOnGround = false; @@ -484,7 +484,7 @@ class $modify(PlayerObject) { pl->checkCollisions(p2, newTimeFactor, true); p2->updateRotation(newTimeFactor); } - else if (isPlatformer && !firstLoop) { + else if (isPlatformer && step.deltaFactor != 1.0) { if (firstLoop) p2->m_isOnGround = p2StartedOnGround; else p2->m_isOnGround = false;