fix the EndIncreaseEdicts handlers as edicts beyond num_edicts are not initialized yet
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 4 May 2010 05:14:45 +0000 (05:14 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 4 May 2010 05:14:45 +0000 (05:14 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10169 d7cf8633-e32d-0410-b094-e92efae38249

csprogs.c
sv_main.c

index d8a3967..bdb0e48 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -738,7 +738,7 @@ void CL_VM_CB_EndIncreaseEdicts(void)
        prvm_edict_t *ent;
 
        // link every entity except world
-       for (i = 1, ent = prog->edicts;i < prog->max_edicts;i++, ent++)
+       for (i = 1, ent = prog->edicts;i < prog->num_edicts;i++, ent++)
                if (!ent->priv.server->free)
                        CL_LinkEdict(ent);
 }
index 612f6fe..6982ef3 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -3351,7 +3351,7 @@ static void SV_VM_CB_EndIncreaseEdicts(void)
        prvm_edict_t *ent;
 
        // link every entity except world
-       for (i = 1, ent = prog->edicts;i < prog->max_edicts;i++, ent++)
+       for (i = 1, ent = prog->edicts;i < prog->num_edicts;i++, ent++)
                if (!ent->priv.server->free)
                        SV_LinkEdict(ent);
 }