]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
New OffscreenGecko scripting stuff
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index f395b478f8b454df1f27f197777d42732dc62a6a..7862e440f2b95a519a8378518b5c40c069de8421 100644 (file)
--- a/host.c
+++ b/host.c
@@ -516,6 +516,13 @@ void Host_ShutdownServer(void)
        for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
                if (host_client->active)
                        SV_DropClient(false); // server shutdown
+       if(prog->loaded)
+               if(prog->funcoffsets.SV_Shutdown)
+               {
+                       func_t s = prog->funcoffsets.SV_Shutdown;
+                       prog->funcoffsets.SV_Shutdown = 0; // prevent it from getting called again
+                       PRVM_ExecuteProgram(s,"SV_Shutdown() required");
+               }
        SV_VM_End();
 
        NetConn_CloseServerPorts();