Skip to content

Commit

Permalink
fix double jump
Browse files Browse the repository at this point in the history
  • Loading branch information
theyareonit committed Aug 2, 2024
1 parent 15713b1 commit 86a906b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v1.1.21

* Fix an exploit that could allow you to double jump
*

# v1.1.20

* bandaid fix for upward slopes cuz whatever
Expand Down
4 changes: 2 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"geode": "3.2.0",
"geode": "3.4.0",
"gd": {
"win": "2.206"
},
"version": "v1.1.20",
"version": "v1.1.21",
"id": "syzzi.click_between_frames",
"name": "Click Between Frames",
"developer": "syzzi",
Expand Down
12 changes: 6 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ void inputThread() {
WNDCLASS wc = {};
wc.lpfnWndProc = WindowProc;
wc.hInstance = GetModuleHandleA(NULL);
wc.lpszClassName = "Click Between Frames";
wc.lpszClassName = "CBF";

RegisterClass(&wc);
HWND hwnd = CreateWindow("Click Between Frames", "Raw Input Window", 0, 0, 0, 0, 0, HWND_MESSAGE, 0, wc.hInstance, 0);
HWND hwnd = CreateWindow("CBF", "Raw Input Window", 0, 0, 0, 0, 0, HWND_MESSAGE, 0, wc.hInstance, 0);
if (!hwnd) {
const DWORD err = GetLastError();
log::error("Failed to create raw input window: {}", err);
Expand All @@ -171,12 +171,12 @@ void inputThread() {

RAWINPUTDEVICE dev[2];
dev[0].usUsagePage = 0x01; // generic desktop controls
dev[0].usUsage = 0x06; // keyboard
dev[0].usUsage = 0x02; // mouse
dev[0].dwFlags = RIDEV_INPUTSINK; // allow inputs without being in the foreground
dev[0].hwndTarget = hwnd; // raw input window

dev[1].usUsagePage = 0x01;
dev[1].usUsage = 0x02; // mouse
dev[1].usUsage = 0x06; // keyboard
dev[1].dwFlags = RIDEV_INPUTSINK;
dev[1].hwndTarget = hwnd;

Expand Down Expand Up @@ -455,7 +455,7 @@ class $modify(PlayerObject) {
if (p1NotBuffering) {
PlayerObject::update(newTimeFactor);
if (!step.endStep) {
if (firstLoop) this->m_isOnGround = p1StartedOnGround; // this fixes delayed inputs on platforms moving down for some reason
if (firstLoop && (this->m_yVelocity < 0 ^ this->m_isUpsideDown)) this->m_isOnGround = p1StartedOnGround; // this fixes delayed inputs on platforms moving down for some reason
if (!this->m_isOnSlope || this->m_isDart) pl->checkCollisions(this, 0.0f, true);
PlayerObject::updateRotation(newTimeFactor);
newResetCollisionLog(this);
Expand All @@ -469,7 +469,7 @@ class $modify(PlayerObject) {
if (p2NotBuffering) {
p2->update(newTimeFactor);
if (!step.endStep) {
if (firstLoop) p2->m_isOnGround = p2StartedOnGround;
if (firstLoop && (p2->m_yVelocity < 0 ^ p2->m_isUpsideDown)) p2->m_isOnGround = p2StartedOnGround;
if (!p2->m_isOnSlope || p2->m_isDart) pl->checkCollisions(p2, 0.0f, true);
p2->updateRotation(newTimeFactor);
newResetCollisionLog(p2);
Expand Down

0 comments on commit 86a906b

Please sign in to comment.