]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_execprogram.h
tiny cleanup to RotatePointAroundVector (uses a VectorCopy instead of 3 lines)
[xonotic/darkplaces.git] / pr_execprogram.h
index f41a4c5919debca869768404812df366c2133701..33dc3e0a7e27f4b9904683aee336660444d21bfa 100644 (file)
@@ -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;
                                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;
                        case OP_ADDRESS:
                                pr_xstatement = st - pr_statements;
 #if PRBOUNDSCHECK
-                               if ((unsigned int)OPB->_int >= progs->entityfields)
+                               if ((unsigned int)(OPB->_int) >= (unsigned int)(progs->entityfields))
                                {
                                        Host_Error("Progs attempted to address an invalid field (%i) in an edict\n", OPB->_int);
                                        return;
                        case OP_LOAD_FNC:
                                pr_xstatement = st - pr_statements;
 #if PRBOUNDSCHECK
-                               if ((unsigned int)OPB->_int >= progs->entityfields)
+                               if ((unsigned int)(OPB->_int) >= (unsigned int)(progs->entityfields))
                                {
                                        Host_Error("Progs attempted to read an invalid field in an edict (%i)\n", OPB->_int);
                                        return;