From 5e10c813499af5825148b9fa0b3c655d1343cbf5 Mon Sep 17 00:00:00 2001 From: Explodingbill Date: Fri, 30 Aug 2024 18:19:00 +1000 Subject: [PATCH] na na na bo bo --- src/Hacks/Show Trajectory/Trajectory.cpp | 24 ++++++++++++------------ src/Hacks/Show Trajectory/Trajectory.hpp | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Hacks/Show Trajectory/Trajectory.cpp b/src/Hacks/Show Trajectory/Trajectory.cpp index 09bb2b1..252d91b 100644 --- a/src/Hacks/Show Trajectory/Trajectory.cpp +++ b/src/Hacks/Show Trajectory/Trajectory.cpp @@ -93,33 +93,33 @@ void TrajectoryPlayerObject::playSpiderDashEffect(cocos2d::CCPoint from, cocos2d PlayerObject::playSpiderDashEffect(from, to); } -/*void TrajectoryBGL::collisionCheckObjects(PlayerObject* p0, gd::vector* p1, int p2, float p3) +void TrajectoryBGL::collisionCheckObjects(PlayerObject* p0, gd::vector* p1, int p2, float p3) { if (p0 == m_fields->trajectoryPlayer) { - gd::vector objsOld = *p1; + gd::vector p1old = *p1; - p1->clear(); - - for (auto obj : objsOld) + auto new_end = std::remove_if(p1->begin(), p1->end(), [](GameObject* obj) { + bool del = true; + if (obj->m_objectType == GameObjectType::Solid || obj->m_objectType == GameObjectType::Hazard || obj->m_objectType == GameObjectType::AnimatedHazard || obj->m_objectType == GameObjectType::Slope) - { - p1->push_back(obj); - } - } + del = false; + + return del; + }); + p1->erase(new_end, p1->end()); p2 = p1->size(); GJBaseGameLayer::collisionCheckObjects(p0, p1, p2, p3); - *p1 = objsOld; - + *p1 = p1old; return; } GJBaseGameLayer::collisionCheckObjects(p0, p1, p2, p3); -}*/ +} void TrajectoryBGL::checkRepellPlayer() { diff --git a/src/Hacks/Show Trajectory/Trajectory.hpp b/src/Hacks/Show Trajectory/Trajectory.hpp index 7223d32..b95b30c 100644 --- a/src/Hacks/Show Trajectory/Trajectory.hpp +++ b/src/Hacks/Show Trajectory/Trajectory.hpp @@ -33,7 +33,7 @@ class $modify (TrajectoryBGL, GJBaseGameLayer) void resetSimulation(PlayerObject* player); void simulateTrajectory(bool press, PlayerObject* player); - //void collisionCheckObjects(PlayerObject* p0, gd::vector* p1, int p2, float p3); + void collisionCheckObjects(PlayerObject* p0, gd::vector* p1, int p2, float p3); void checkRepellPlayer(); // Runs every tick QOLMOD_MOD_ALL_HOOKS("show-trajectory")