Skip to content

Commit 7b439e2

Browse files
committed
fix: Added bad unload message
Added message to let user know they shouldn't unload plugin mid play session.
1 parent c4ea64c commit 7b439e2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

p2mm.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ bool CP2MMServerPlugin::Load(CreateInterfaceFn interfaceFactory, const CreateInt
155155
if (m_bPluginLoaded)
156156
{
157157
Log(WARNING, false, "Plugin already loaded!");
158-
m_bNoUnload = true;
159158
return false;
160159
}
161160

@@ -518,6 +517,15 @@ void CP2MMServerPlugin::Unload(void)
518517
return;
519518
}
520519

520+
if (IsGameActive())
521+
{
522+
m_bNoUnload = false;
523+
Log(WARNING, false, "You unloaded the P2:MM plugin mid play session! This will cause issues and crashes!");
524+
Log(WARNING, false, "You unloaded the P2:MM plugin mid play session! This will cause issues and crashes!");
525+
Log(WARNING, false, "You unloaded the P2:MM plugin mid play session! This will cause issues and crashes!");
526+
return;
527+
}
528+
521529
Log(INFO, false, "Unloading Plugin...");
522530
this->m_bPluginUnloading = true;
523531
CDiscordIntegration::UpdateDiscordRPC();

0 commit comments

Comments
 (0)