]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
added prvm_offsets.h which centralizes field/global/function lookups for
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 812c2146e60787e13d27640cbeaa53591794b148..d8909c14a884c0cc5adad10d9ac7e6ada2074294 100644 (file)
--- a/host.c
+++ b/host.c
@@ -567,10 +567,10 @@ void Host_ShutdownServer(void)
        SV_VM_Begin();
        World_End(&sv.world);
        if(prog->loaded)
-               if(prog->funcoffsets.SV_Shutdown)
+               if(PRVM_serverfunction(SV_Shutdown))
                {
-                       func_t s = prog->funcoffsets.SV_Shutdown;
-                       prog->funcoffsets.SV_Shutdown = 0; // prevent it from getting called again
+                       func_t s = PRVM_serverfunction(SV_Shutdown);
+                       PRVM_serverfunction(SV_Shutdown) = 0; // prevent it from getting called again
                        PRVM_ExecuteProgram(s,"SV_Shutdown() required");
                }
        for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
@@ -861,7 +861,7 @@ void Host_Main(void)
                        
                        if (sv.paused == 1 && realtime > sv.pausedstart && sv.pausedstart > 0) {
                                prog->globals.generic[OFS_PARM0] = realtime - sv.pausedstart;
-                               PRVM_ExecuteProgram(prog->funcoffsets.SV_PausedTic, "QC function SV_PausedTic is missing");
+                               PRVM_ExecuteProgram(PRVM_serverfunction(SV_PausedTic), "QC function SV_PausedTic is missing");
                        }
 
                        // end the server VM frame