]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
reverted dynamic allocation of sv.edicts because there are FAR too many broken pointe...
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index d11b8f66fe1444d03c9c64c7623fad4240b1ee27..c5c783b56eec9cd3dd702f078da35ad2f68a2e0e 100644 (file)
--- a/host.c
+++ b/host.c
@@ -455,12 +455,12 @@ void SV_DropClient (qboolean crash)
        // note: don't clear name yet
        net_activeconnections--;
 
-       if (sv.active && host_client->edictnumber && host_client->spawned) // LordHavoc: don't call QC if server is dead (avoids recursive Host_Error in some mods when they run out of edicts)
+       if (sv.active && host_client->edict && host_client->spawned) // LordHavoc: don't call QC if server is dead (avoids recursive Host_Error in some mods when they run out of edicts)
        {
        // call the prog function for removing a client
        // this will set the body to a dead frame, among other things
                saveSelf = pr_global_struct->self;
-               pr_global_struct->self = EDICT_TO_PROG(EDICT_NUM(host_client->edictnumber));
+               pr_global_struct->self = EDICT_TO_PROG(host_client->edict);
                PR_ExecuteProgram (pr_global_struct->ClientDisconnect, "QC function ClientDisconnect is missing");
                pr_global_struct->self = saveSelf;
        }