]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_execprogram.h
you can now (try to) play in maps you don't have, and models you don't have are shown...
[xonotic/darkplaces.git] / pr_execprogram.h
index fd306cf2154a0fc1bcbb1a0c2f1963374369be22..05e861030470c53474e20006edc8ba6073a47963 100644 (file)
@@ -7,7 +7,7 @@
                        if (++profile > 1000000) // LordHavoc: increased runaway loop limit 10x
                        {
                                pr_xstatement = st - pr_statements;
-                               PR_RunError ("runaway loop error");
+                               Host_Error ("runaway loop error");
                        }
 
 #if PRTRACE
                                if (OPB->_int < 0 || OPB->_int + 4 > pr_edictareasize)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to write to an out of bounds edict\n");
+                                       Host_Error("Progs attempted to write to an out of bounds edict\n");
                                        return;
                                }
                                if (OPB->_int % pr_edict_size < ((qbyte *)&sv.edicts->v - (qbyte *)sv.edicts))
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to write to an engine edict field\n");
+                                       Host_Error("Progs attempted to write to an engine edict field\n");
                                        return;
                                }
 #endif
                                if (OPB->_int < 0 || OPB->_int + 12 > pr_edictareasize)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to write to an out of bounds edict\n");
+                                       Host_Error("Progs attempted to write to an out of bounds edict\n");
                                        return;
                                }
 #endif
                                        if (OPA->edict == 0 && sv.state == ss_active)
                                        {
                                                pr_xstatement = st - pr_statements;
-                                               PR_RunError ("assignment to world entity");
+                                               Host_Error ("assignment to world entity");
                                                return;
                                        }
                                        else
                                        {
                                                pr_xstatement = st - pr_statements;
-                                               PR_RunError("Progs attempted to address an out of bounds edict\n");
+                                               Host_Error("Progs attempted to address an out of bounds edict\n");
                                                return;
                                        }
                                }
                                else if (OPA->edict >= pr_edictareasize)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to address an out of bounds edict\n");
+                                       Host_Error("Progs attempted to address an out of bounds edict\n");
                                        return;
                                }
                                if (OPB->_int < 0 || OPB->_int >= progs->entityfields)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to address an invalid field in an edict\n");
+                                       Host_Error("Progs attempted to address an invalid field in an edict\n");
                                        return;
                                }
 #else
                                if (OPA->edict == 0 && sv.state == ss_active)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError ("assignment to world entity");
+                                       Host_Error ("assignment to world entity");
                                        return;
                                }
 #endif
                                if (OPA->edict < 0 || OPA->edict >= pr_edictareasize)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to read an out of bounds edict number\n");
+                                       Host_Error("Progs attempted to read an out of bounds edict number\n");
                                        return;
                                }
                                if (OPB->_int < 0 || OPB->_int >= progs->entityfields)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to read an invalid field in an edict\n");
+                                       Host_Error("Progs attempted to read an invalid field in an edict\n");
                                        return;
                                }
 #endif
                                if (OPA->edict < 0 || OPA->edict >= pr_edictareasize)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to read an out of bounds edict number\n");
+                                       Host_Error("Progs attempted to read an out of bounds edict number\n");
                                        return;
                                }
                                if (OPB->_int < 0 || OPB->_int + 2 >= progs->entityfields)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to read an invalid field in an edict\n");
+                                       Host_Error("Progs attempted to read an invalid field in an edict\n");
                                        return;
                                }
 #endif
                                pr_xstatement = st - pr_statements;
                                pr_argc = st->op - OP_CALL0;
                                if (!OPA->function)
-                                       PR_RunError ("NULL function");
+                                       Host_Error ("NULL function");
 
                                newf = &pr_functions[OPA->function];
 
                                {
                                        // negative statements are built in functions
                                        if ((-newf->first_statement) >= pr_numbuiltins)
-                                               PR_RunError ("Bad builtin call number");
+                                               Host_Error ("Bad builtin call number");
                                        pr_builtins[-newf->first_statement] ();
                                }
                                else
                                if (OPB->_int < 0 || OPB->_int + 4 > pr_edictareasize)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to write to an out of bounds edict\n");
+                                       Host_Error("Progs attempted to write to an out of bounds edict\n");
                                        return;
                                }
                                if (OPB->_int % pr_edict_size < ((qbyte *)&sv.edicts->v - (qbyte *)sv.edicts))
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to write to an engine edict field\n");
+                                       Host_Error("Progs attempted to write to an engine edict field\n");
                                        return;
                                }
 #endif
                                if (OPA->edict < 0 || OPA->edict >= pr_edictareasize)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to read an out of bounds edict number\n");
+                                       Host_Error("Progs attempted to read an out of bounds edict number\n");
                                        return;
                                }
                                if (OPB->_int < 0 || OPB->_int >= progs->entityfields)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to read an invalid field in an edict\n");
+                                       Host_Error("Progs attempted to read an invalid field in an edict\n");
                                        return;
                                }
 #endif
                                if (OPB->_int < 0 || OPB->_int >= pr_globaldefs)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to write to an invalid indexed global\n");
+                                       Host_Error("Progs attempted to write to an invalid indexed global\n");
                                        return;
                                }
 #endif
                                if (OPB->_int < 0 || OPB->_int + 2 >= pr_globaldefs)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to write to an invalid indexed global\n");
+                                       Host_Error("Progs attempted to write to an invalid indexed global\n");
                                        return;
                                }
 #endif
                                if (i < 0 || i >= pr_globaldefs)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to address an out of bounds global\n");
+                                       Host_Error("Progs attempted to address an out of bounds global\n");
                                        return;
                                }
 #endif
                                if (OPA->_int < 0 || OPA->_int >= pr_globaldefs)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to read an invalid indexed global\n");
+                                       Host_Error("Progs attempted to read an invalid indexed global\n");
                                        return;
                                }
 #endif
                                if (OPA->_int < 0 || OPA->_int + 2 >= pr_globaldefs)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs attempted to read an invalid indexed global\n");
+                                       Host_Error("Progs attempted to read an invalid indexed global\n");
                                        return;
                                }
 #endif
                                if (OPA->_int < 0 || OPA->_int >= st->b)
                                {
                                        pr_xstatement = st - pr_statements;
-                                       PR_RunError("Progs boundcheck failed at line number %d, value is < 0 or >= %d\n", st->b, st->c);
+                                       Host_Error("Progs boundcheck failed at line number %d, value is < 0 or >= %d\n", st->b, st->c);
                                        return;
                                }
                                break;
 
                        default:
                                pr_xstatement = st - pr_statements;
-                               PR_RunError ("Bad opcode %i", st->op);
+                               Host_Error ("Bad opcode %i", st->op);
                        }
                }