Skip to content

Commit

Permalink
fix platformer again............
Browse files Browse the repository at this point in the history
  • Loading branch information
theyareonit committed Jun 22, 2024
1 parent 4271985 commit aaceab7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const step emptyStep = step{ emptyInput, 1.0, true };

std::queue<struct inputEvent> inputQueue;

std::set<size_t> inputBinds[6];
std::set<USHORT> heldInputs;
std::unordered_set<size_t> inputBinds[6];
std::unordered_set<USHORT> heldInputs;

CRITICAL_SECTION inputQueueLock;
CRITICAL_SECTION keybindsLock;
Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit aaceab7

Please sign in to comment.