]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix PRVM error and warning backtrace display
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Mar 2011 19:57:52 +0000 (19:57 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Mar 2011 19:57:52 +0000 (19:57 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10961 d7cf8633-e32d-0410-b094-e92efae38249

prvm_execprogram.h

index 1f8bbc62a57ce82ef8387a352463ffbbc8ad7bd3..719224d0246d1e523384a1850504cfaa20814a15 100644 (file)
@@ -1,10 +1,12 @@
 #ifdef PRVMTIMEPROFILING 
 #define PreError() \
+       prog->xstatement = st - prog->statements; \
        tm = Sys_DoubleTime(); \
        prog->xfunction->profile += (st - startst); \
        prog->xfunction->tprofile += (tm - starttm);
 #else
 #define PreError() \
+       prog->xstatement = st - prog->statements; \
        prog->xfunction->profile += (st - startst);
 #endif
 
                                        goto cleanup;
                                }
                                if (OPB->_int < prog->progs->entityfields && !prog->allowworldwrites)
+                               {
+                                       prog->xstatement = st - prog->statements;
                                        VM_Warning("assignment to world.%s (field %i) in %s\n", PRVM_GetString(PRVM_ED_FieldAtOfs(OPB->_int)->s_name), OPB->_int, PRVM_NAME);
+                               }
                                ptr = (prvm_eval_t *)(prog->edictsfields + OPB->_int);
                                ptr->_int = OPA->_int;
                                break;
                                        goto cleanup;
                                }
                                if (OPB->_int < prog->progs->entityfields && !prog->allowworldwrites)
+                               {
+                                       prog->xstatement = st - prog->statements;
                                        VM_Warning("assignment to world.%s (field %i) in %s\n", PRVM_GetString(PRVM_ED_FieldAtOfs(OPB->_int)->s_name), OPB->_int, PRVM_NAME);
+                               }
                                ptr = (prvm_eval_t *)(prog->edictsfields + OPB->_int);
                                ptr->ivector[0] = OPA->ivector[0];
                                ptr->ivector[1] = OPA->ivector[1];