Skip to content

Commit

Permalink
l
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Aug 15, 2024
1 parent 08b66de commit c60ad52
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.5.8

- Fixed not being able to use checkpoints in platformer with all modes platformer enabled

# 1.5.7

- Fixed Mouse Cursor not disappearing when closing the menu while in a level
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "3.4.0",
"version": "v1.5.7",
"version": "v1.5.8",
"gd": {
"win": "2.206",
"android": "2.206",
Expand Down
39 changes: 34 additions & 5 deletions src/Hacks/AllModesPlatformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,42 @@ using namespace geode::prelude;
class $modify (GJBaseGameLayer)
{
void collisionCheckObjects(PlayerObject* p0, gd::vector<GameObject*>* p1, int p2, float p3)
{
auto p = m_isPlatformer;
m_isPlatformer = false;
{
if (p0 && p1)
{
for (size_t i = 0; i < p1->size(); i++)
{
auto obj = p1->at(i);

GJBaseGameLayer::collisionCheckObjects(p0, p1, p2, p3);
if (!obj)
break;

if (p0->getObjectRect().intersectsRect(obj->getObjectRect()))
{
if (obj->m_objectType == GameObjectType::WavePortal || obj->m_objectType == GameObjectType::SwingPortal)
{
if(this->canBeActivatedByPlayer(p0, as<EffectGameObject*>(obj)))
{
this->playerWillSwitchMode(p0, obj);
#ifdef GEODE_IS_WINDOWS
p0->switchedToMode(obj->m_objectType);

m_isPlatformer = p;
if (obj->m_objectType == GameObjectType::SwingPortal)
p0->toggleSwingMode(true, false);
else
p0->toggleDartMode(true, false);

#else
this->switchToFlyMode(p0, obj, false, as<int>(obj->m_objectType));
#endif
obj->playShineEffect();
}
}
}
}
}

GJBaseGameLayer::collisionCheckObjects(p0, p1, p2, p3);
}

QOLMOD_MOD_HOOK("all-plat", "GJBaseGameLayer::collisionCheckObjects")
Expand Down
3 changes: 3 additions & 0 deletions src/Hacks/ShowTouches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class $modify (CCTouchDispatcher)
if (!CCScene::get())
return;

if (getChildOfType<LoadingLayer>(CCScene::get(), 0))
return;

if (type == CCTOUCHBEGAN)
{
if (auto touch = as<CCTouch*>(touches->anyObject()))
Expand Down

0 comments on commit c60ad52

Please sign in to comment.