]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_execprogram.h
-Added the callcount field to the mfunction_t structure.
[xonotic/darkplaces.git] / pr_execprogram.h
index 9cc8ed4c35ed6d34b3ec63a2f56715b437028276..3ea2241ebb880f7016fdf149158d8ace205570b9 100644 (file)
                                startprofile = profile;
                                pr_xstatement = st - pr_statements;
                                pr_argc = st->op - OP_CALL0;
-                               if (!OPA->function)
+                               if (!OPA->function )
                                        Host_Error("NULL function");
+                               else if (OPA->function > (unsigned) progs->numfunctions)
+                                       Host_Error("Bad function number");
 
                                newf = &pr_functions[OPA->function];
+                               newf->callcount++;
 
                                if (newf->first_statement < 0)
                                {
                                }
                                else
                                        st = pr_statements + PR_EnterFunction(newf);
+                               if (pr_trace != cachedpr_trace)
+                                       goto chooseexecprogram;
                                break;
 
                        case OP_DONE: