X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=pr_execprogram.h;h=4c2001eee276a8e924780d9a2d91d112d0fe39e1;hb=4596c46213ae652af1b2e4bc6b691076cff2c416;hp=be8468bcfccbde1adc3f10a2ad396e71ab92faa8;hpb=6fb3daf04a26ac42b15c02c2276f6820ffe795a8;p=xonotic%2Fdarkplaces.git diff --git a/pr_execprogram.h b/pr_execprogram.h index be8468bc..4c2001ee 100644 --- a/pr_execprogram.h +++ b/pr_execprogram.h @@ -4,7 +4,7 @@ while (1) { st++; - if (++profile > 1000000) // LordHavoc: increased runaway loop limit 10x + if (++profile > 10000000) // LordHavoc: increased runaway loop limit 100x { pr_xstatement = st - pr_statements; Host_Error ("runaway loop error"); @@ -82,7 +82,7 @@ OPC->_float = !OPA->vector[0] && !OPA->vector[1] && !OPA->vector[2]; break; case OP_NOT_S: - OPC->_float = !OPA->string || !pr_strings[OPA->string]; + OPC->_float = !OPA->string || !*PR_GetString(OPA->string); break; case OP_NOT_FNC: OPC->_float = !OPA->function; @@ -97,7 +97,7 @@ OPC->_float = (OPA->vector[0] == OPB->vector[0]) && (OPA->vector[1] == OPB->vector[1]) && (OPA->vector[2] == OPB->vector[2]); break; case OP_EQ_S: - OPC->_float = !strcmp(pr_strings+OPA->string,pr_strings+OPB->string); + OPC->_float = !strcmp(PR_GetString(OPA->string),PR_GetString(OPB->string)); break; case OP_EQ_E: OPC->_float = OPA->_int == OPB->_int; @@ -112,7 +112,7 @@ OPC->_float = (OPA->vector[0] != OPB->vector[0]) || (OPA->vector[1] != OPB->vector[1]) || (OPA->vector[2] != OPB->vector[2]); break; case OP_NE_S: - OPC->_float = strcmp(pr_strings+OPA->string,pr_strings+OPB->string); + OPC->_float = strcmp(PR_GetString(OPA->string),PR_GetString(OPB->string)); break; case OP_NE_E: OPC->_float = OPA->_int != OPB->_int; @@ -130,9 +130,9 @@ OPB->_int = OPA->_int; break; case OP_STORE_V: - OPB->vector[0] = OPA->vector[0]; - OPB->vector[1] = OPA->vector[1]; - OPB->vector[2] = OPA->vector[2]; + OPB->ivector[0] = OPA->ivector[0]; + OPB->ivector[1] = OPA->ivector[1]; + OPB->ivector[2] = OPA->ivector[2]; break; case OP_STOREP_F: @@ -253,9 +253,12 @@ if (newf->first_statement < 0) { // negative statements are built in functions - if ((-newf->first_statement) >= pr_numbuiltins) - Host_Error ("Bad builtin call number"); - pr_builtins[-newf->first_statement] (); + int builtinnumber = -newf->first_statement; + pr_xfunction->builtinsprofile++; + if (builtinnumber < pr_numbuiltins && pr_builtins[builtinnumber]) + pr_builtins[builtinnumber] (); + else + Host_Error ("No such builtin #%i", builtinnumber); } else st = pr_statements + PR_EnterFunction(newf);