diff --git a/changelog.md b/changelog.md index c9cb670..b9b0631 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +# v1.0.2 + +- fix interaction with slopes + # v1.0.1 - fix a glitch on the dual wave diff --git a/mod.json b/mod.json index eb9b9a1..858a341 100644 --- a/mod.json +++ b/mod.json @@ -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", diff --git a/src/main.cpp b/src/main.cpp index 65d7b7d..3764c24 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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) @@ -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(); + } };