]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_cmds.c
Fix r_glsl_dumpshader segfault
[xonotic/darkplaces.git] / prvm_cmds.c
index f60d2d4e5b28b1d60332ddea881865035329fa28..6a19baff45df819cfb499a71809ce872d683377f 100644 (file)
@@ -65,13 +65,13 @@ void VM_CheckEmptyString(prvm_prog_t *prog, const char *s)
                prog->error_cmd("%s: Bad string", prog->name);
 }
 
-qbool PRVM_ConsoleCommand(prvm_prog_t *prog, const char *text, size_t textlen, int *func, qbool preserve_self, int curself, double ptime, qbool prog_loaded, const char *error_message)
+qbool PRVM_ConsoleCommand(prvm_prog_t *prog, const char *text, size_t textlen, int *func, qbool preserve_self, int curself, double ptime, const char *error_message)
 {
        int restorevm_tempstringsbuf_cursize;
        int save_self = 0; // hush compiler warning
        qbool r = false;
 
-       if(!prog_loaded)
+       if(!prog->loaded)
                return false;
 
        if(func)
@@ -3428,7 +3428,7 @@ void VM_getkeybind (prvm_prog_t *prog)
        else
                bindmap = 0; // consistent to "bind"
        bind = Key_GetBind((int)PRVM_G_FLOAT(OFS_PARM0), bindmap);
-       PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, bind, strlen(bind));
+       PRVM_G_INT(OFS_RETURN) = bind ? PRVM_SetTempString(prog, bind, strlen(bind)) : 0;
 }
 
 /*
@@ -5688,7 +5688,7 @@ void VM_nudgeoutofsolid(prvm_prog_t *prog)
                else if (prog == CLVM_prog)
                        CL_LinkEdict(ent);
                else
-                       Sys_Abort("PHYS_NudgeOutOfSolid: cannot be called from %s VM\n", prog->name);
+                       Sys_Error("PHYS_NudgeOutOfSolid: cannot be called from %s VM\n", prog->name);
        }
 }