]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Changed prvm_ed_loadfromfile - it isnt really compatible with the old vm anymore...
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 23 Oct 2003 19:47:08 +0000 (19:47 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 23 Oct 2003 19:47:08 +0000 (19:47 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3604 d7cf8633-e32d-0410-b094-e92efae38249

menu.c
prvm_cmds.c
prvm_edict.c
prvm_exec.c

diff --git a/menu.c b/menu.c
index 5978e5b2977003691c7fd2d7faf02ed9b8a75ea2..1ad0b4c36b702358436a5eb6e4e23a54cdce6e80 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -3734,6 +3734,7 @@ void M_Shutdown(void)
 
 void M_Restart(void)
 {
+       key_dest = key_game;
 }
 
 //============================================================================
@@ -3765,7 +3766,7 @@ void MP_Error(void)
        // fall back to the normal menu
 
        // say it
-       Con_Printf("Falling back to normal menu.\n Error :");
+       Con_Printf("Falling back to normal menu\n");
 
        // init the normal menu now -> this will also correct the menu router pointers
        MR_SetRouting (TRUE);
@@ -3874,6 +3875,7 @@ void MP_Init (void)
 
 void MP_Restart(void)
 {
+       key_dest = key_game;
        MP_Init();
 }
 
index bf26c4b4e3c5e86e9630b11863319d67ad3c854a..0b4fb015b32a5798be9b43617e7dceb41420e548 100644 (file)
@@ -2145,13 +2145,15 @@ void VM_loadfromfile(void)
                return;
        }
 
-       data = FS_LoadFile(va("data/%s", filename), false);
+       // not conform with VM_fopen
+       data = FS_LoadFile(filename, false);
        if (data == NULL)
                PRVM_G_FLOAT(OFS_RETURN) = -1;
        
        PRVM_ED_LoadFromFile(data);
 
-       Mem_Free(data);
+       if(data)
+               Mem_Free(data);
 }
 
 
index 064321296fd02ccbb42e992694e3d2e925748fe5..5ed79417cc76206b2aafe645bc0a559f96ef5134 100644 (file)
@@ -958,7 +958,7 @@ qboolean PRVM_ED_ParseEpair(prvm_edict_t *ent, ddef_t *key, const char *s)
                def = PRVM_ED_FindField(s);
                if (!def)
                {
-                       Con_DPrintf("PRVM_ED_ParseEpair: Can't find field %s on %s\n", s, PRVM_NAME);
+                       Con_DPrintf("PRVM_ED_ParseEpair: Can't find field %s in %s\n", s, PRVM_NAME);
                        return false;
                }
                val->_int = PRVM_G_INT(def->ofs);
@@ -968,7 +968,7 @@ qboolean PRVM_ED_ParseEpair(prvm_edict_t *ent, ddef_t *key, const char *s)
                func = PRVM_ED_FindFunction(s);
                if (!func)
                {
-                       Con_Printf ("PRVM_ED_ParseEpair: Can't find function %s on %s\n", s, PRVM_NAME);
+                       Con_Printf ("PRVM_ED_ParseEpair: Can't find function %s in %s\n", s, PRVM_NAME);
                        return false;
                }
                val->function = func - prog->functions;
index adaf7967eb16f057997a96d779a225966580a3aa..7ba8a1b2d1446e651b449e8b3d1eb5f3908a48a5 100644 (file)
@@ -233,7 +233,8 @@ void PRVM_Profile_f (void)
 void PRVM_CrashAll()
 {
        int i;
-       PRVM_Begin; 
+       prvm_prog_t *oldprog = prog;
+
        for(i = 0; i < PRVM_MAXPROGS; i++)
        {
                if(!PRVM_ProgLoaded(i))
@@ -241,7 +242,8 @@ void PRVM_CrashAll()
                PRVM_SetProg(i);
                PRVM_Crash();
        }
-       PRVM_End;
+       
+       prog = oldprog;
 }
 
 void PRVM_Crash()