X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=pr_execprogram.h;h=fd306cf2154a0fc1bcbb1a0c2f1963374369be22;hb=bc8b80ee19f7a87e326fa765427d0c4e8dfe9940;hp=524ca44feddd1efdd49242dbf3d74c033c5ac1e7;hpb=d57be67cb00229acb8564b92c8b7c58eeed8a0cb;p=xonotic%2Fdarkplaces.git diff --git a/pr_execprogram.h b/pr_execprogram.h index 524ca44f..fd306cf2 100644 --- a/pr_execprogram.h +++ b/pr_execprogram.h @@ -1,3 +1,6 @@ + +// This code isn't #ifdef/#define protectable, don't try. + while (1) { st++; @@ -144,14 +147,14 @@ PR_RunError("Progs attempted to write to an out of bounds edict\n"); return; } - if (OPB->_int % pr_edict_size < ((byte *)&sv.edicts->v - (byte *)sv.edicts)) + 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"); return; } #endif - ptr = (eval_t *)((byte *)sv.edicts + OPB->_int); + ptr = (eval_t *)((qbyte *)sv.edicts + OPB->_int); ptr->_int = OPA->_int; break; case OP_STOREP_V: @@ -163,7 +166,7 @@ return; } #endif - ptr = (eval_t *)((byte *)sv.edicts + OPB->_int); + ptr = (eval_t *)((qbyte *)sv.edicts + OPB->_int); ptr->vector[0] = OPA->vector[0]; ptr->vector[1] = OPA->vector[1]; ptr->vector[2] = OPA->vector[2]; @@ -207,7 +210,7 @@ } #endif ed = PROG_TO_EDICT(OPA->edict); - OPC->_int = (byte *)((int *)&ed->v + OPB->_int) - (byte *)sv.edicts; + OPC->_int = (qbyte *)((int *)&ed->v + OPB->_int) - (qbyte *)sv.edicts; break; case OP_LOAD_F: @@ -480,14 +483,14 @@ PR_RunError("Progs attempted to write to an out of bounds edict\n"); return; } - if (OPB->_int % pr_edict_size < ((byte *)&sv.edicts->v - (byte *)sv.edicts)) + 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"); return; } #endif - ptr = (eval_t *)((byte *)sv.edicts + OPB->_int); + ptr = (eval_t *)((qbyte *)sv.edicts + OPB->_int); ptr->_int = OPA->_int; break; case OP_LOAD_I: @@ -599,3 +602,4 @@ PR_RunError ("Bad opcode %i", st->op); } } +