From 9fd67232c0db5b3bdc1559c40f8d51eb41d40351 Mon Sep 17 00:00:00 2001 From: NyteLyte Date: Tue, 9 Apr 2024 14:21:07 +0200 Subject: [PATCH] extra checks --- changelog.md | 4 ++++ mod.json | 2 +- src/main.cpp | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index a919128..99deae6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +# v1.2.1 + +- add extra checks for whether you are in-game + # v1.2.0 - fix behavior with spider orbs diff --git a/mod.json b/mod.json index 6070338..54b7760 100644 --- a/mod.json +++ b/mod.json @@ -1,7 +1,7 @@ { "geode": "2.0.0-beta.23", "gd": {"android": "2.205", "win": "2.204"}, - "version": "v1.2.0", + "version": "v1.2.1", "id": "nytelyte.wave_trail_drag_fix", "name": "Wave Trail Drag Fix", "developer": "NyteLyte", diff --git a/src/main.cpp b/src/main.cpp index 366c409..78015d8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -43,7 +43,7 @@ class $modify(WTDFPlayerObject, PlayerObject) { void postCollision(float p0) { PlayerObject::postCollision(p0); - if (LevelEditorLayer::get()) return; + if (LevelEditorLayer::get() || !m_gameLayer) return; if (!m_isDart || m_isHidden) { m_fields->previousPos = m_fields->currentPos; return; @@ -199,6 +199,7 @@ class $modify(PlayLayer) { class $modify(GJBaseGameLayer) { void teleportPlayer(TeleportPortalObject *portal, PlayerObject *player) { GJBaseGameLayer::teleportPlayer(portal, player); + if (!player->m_isDart) return; CCPoint targetPos = getPortalTargetPos(portal, getPortalTarget(portal), player); static_cast(player)->m_fields->previousPos = targetPos; static_cast(player)->m_fields->justTeleported = true;