mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-20 05:16:24 -04:00
Correctly unregister gamemodes from the service
This commit is contained in:
@@ -110,7 +110,14 @@ ModResult register_gamemode(ModContext* ctx, const GamemodeDesc* desc) {
|
||||
}
|
||||
|
||||
ModResult unregister_gamemode(ModContext* ctx, const char* id) {
|
||||
dusk::gamemode::getGamemodeManager().unregisterGamemode(get_mod_gamemode_id(ctx,id));
|
||||
std::string fullId = get_mod_gamemode_id(ctx,id);
|
||||
dusk::gamemode::getGamemodeManager().unregisterGamemode(fullId);
|
||||
|
||||
// Remove the gamemode from the service registered gamemodes map
|
||||
auto it = s_gamemodesRegisteredToMods.find(ctx->mod->metadata.id);
|
||||
if (it != s_gamemodesRegisteredToMods.end()) {
|
||||
std::erase(it->second, fullId);
|
||||
}
|
||||
return MOD_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user