Skip to content

Commit

Permalink
fix more tags crash
Browse files Browse the repository at this point in the history
  • Loading branch information
dankmeme01 committed Feb 7, 2024
1 parent 036036f commit 58a631f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions about.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Globed is an open-source, highly customizable multiplayer mod for Geometry Dash,

In the main menu, an extra button is added to the bottom row. This button opens the Globed Menu, where you can join a server and start playing online with other people.

If you have any issues, suggestions or just want to see the development of the mod, you can join the [discord server](https://discord.gg/d56q5Dkdm3)!

## Credit

**mat, alk, and the rest of the Geode team** - thank you for creating Geode and for helping me with the issues I had using it. None of this would've been possible without your awesome efforts, and I really appreciate the work you've put in <3
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
* Use github actions for releases (hopefully no more crashes on old CPUs)
* Add a volume slider for voice chat
* Fixed a crash in the editor
* Fixed an incompatibility with "More Level Tags", should no longer crash when opening a level
18 changes: 15 additions & 3 deletions src/hooks/play_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ bool GlobedPlayLayer::init(GJGameLevel* level, bool p1, bool p2) {
m_fields->playerStore = std::make_shared<PlayerStore>();

// update
Loader::get()->queueInMainThread([this] {
this->rescheduleSelectors();
CCScheduler::get()->scheduleSelector(schedule_selector(GlobedPlayLayer::selUpdate), this->getParent(), 0.0f, false);
Loader::get()->queueInMainThread([] {
auto self = static_cast<GlobedPlayLayer*>(PlayLayer::get());
if (!self) return;

self->rescheduleSelectors();
CCScheduler::get()->scheduleSelector(schedule_selector(GlobedPlayLayer::selUpdate), self->getParent(), 0.0f, false);
});

m_fields->progressBarWrapper = Build<CCNode>::create()
Expand Down Expand Up @@ -184,6 +187,15 @@ void GlobedPlayLayer::onQuit() {
nm.suppressUnhandledFor<VoiceBroadcastPacket>(util::time::seconds(1));
}

void GlobedPlayLayer::destructor() {
if (PlayLayer::get() == this) {
GameManager::get()->m_playLayer = nullptr;
GameManager::get()->m_gameLayer = nullptr;
}

PlayLayer::~PlayLayer();
}

void GlobedPlayLayer::setupPacketListeners() {
auto& nm = NetworkManager::get();

Expand Down
1 change: 1 addition & 0 deletions src/hooks/play_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class $modify(GlobedPlayLayer, PlayLayer) {

bool init(GJGameLevel* level, bool p1, bool p2);
void onQuit();
void destructor();

/* setup stuff to make init() cleaner */

Expand Down

0 comments on commit 58a631f

Please sign in to comment.