Skip to content

Commit

Permalink
fix interaction with slopes
Browse files Browse the repository at this point in the history
  • Loading branch information
nytelytee committed Feb 29, 2024
1 parent b1665b4 commit 8ffe00f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v1.0.2

- fix interaction with slopes

# v1.0.1

- fix a glitch on the dual wave
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"android": "2.205",
"win": "2.204"
},
"version": "v1.0.1",
"version": "v1.0.2",
"id": "nytelyte.wave_trail_drag_fix",
"name": "Wave Trail Drag Fix",
"developer": "NyteLyte",
Expand Down
11 changes: 10 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ class $modify(PlayerObject) {

void update(float p0) {
if (!m_isDart) return PlayerObject::update(p0);

// (part of the) fix for the wave interacting badly with slopes
if (!m_isOnSlope && m_wasOnSlope && m_yVelocity != 0)
m_waveTrail->addPoint(m_fields->prev_position);
// exiting a straight area, put the point on the previous
// frame's position (where the wave was while it was still on
// the straight area)
if (m_yVelocity != 0 && m_fields->prev_yVelocity == 0 && !m_fields->dont_add_point)
else if (m_yVelocity != 0 && m_fields->prev_yVelocity == 0 && !m_fields->dont_add_point)
m_waveTrail->addPoint(m_fields->prev_position);
// entering a straight area, put the point on the current
// frame's position (the wave just landed on the straight area)
Expand All @@ -38,4 +42,9 @@ class $modify(PlayerObject) {
m_fields->dont_add_point = true;
PlayerObject::activateStreak();
}
void placeStreakPoint() {
// (second part of the) fix for the wave interacting badly with slopes
if (!m_isOnSlope && m_wasOnSlope) return;
PlayerObject::placeStreakPoint();
}
};

0 comments on commit 8ffe00f

Please sign in to comment.