]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
PRVM: fix some incorrect warning messages
authorbones_was_here <bones_was_here@xonotic.au>
Thu, 11 Jan 2024 23:08:05 +0000 (09:08 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sun, 21 Jan 2024 07:00:45 +0000 (17:00 +1000)
Closes https://gitlab.com/xonotic/darkplaces/-/issues/379

See 2322e173520b68ae6ca217024a47dfb8bbc12473

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
prvm_execprogram.h

index 99a8990688682f4b87b44ffd5cf3a74b90fc3365..a386aa67b673528186be7ab828a7c6f44738caa3 100644 (file)
@@ -489,7 +489,7 @@ int i;
                                        if ((prvm_uint_t)OPB->_int < cached_entityfields && !cached_allowworldwrites)
                                        {
                                                PRE_ERROR();
-                                               VM_Warning(prog, "Attempted assignment to NULL entity field .%s (%i) in %s\n", PRVM_GetString(prog, PRVM_ED_FieldAtOfs(prog, OPB->_int)->s_name), (int)OPB->_int, prog->name);
+                                               VM_Warning(prog, "Attempted assignment to world.%s (edictnum 0 field %i) in %s\n", PRVM_GetString(prog, PRVM_ED_FieldAtOfs(prog, OPB->_int)->s_name), (int)OPB->_int, prog->name);
                                        }
                                }
                                ptr = (prvm_eval_t *)(cached_edictsfields + OPB->_int);
@@ -507,7 +507,7 @@ int i;
                                        if ((prvm_uint_t)OPB->_int < cached_entityfields && !cached_allowworldwrites)
                                        {
                                                PRE_ERROR();
-                                               VM_Warning(prog, "Attempted assignment to NULL entity field .%s (%i) in %s\n", PRVM_GetString(prog, PRVM_ED_FieldAtOfs(prog, OPB->_int)->s_name), (int)OPB->_int, prog->name);
+                                               VM_Warning(prog, "Attempted assignment to world.%s (edictnum 0 field %i) in %s\n", PRVM_GetString(prog, PRVM_ED_FieldAtOfs(prog, OPB->_int)->s_name), (int)OPB->_int, prog->name);
                                        }
                                }
                                // refresh the garbage collection on the string - this guards
@@ -531,7 +531,7 @@ int i;
                                        if ((prvm_uint_t)OPB->_int < cached_entityfields && !cached_allowworldwrites)
                                        {
                                                PRE_ERROR();
-                                               VM_Warning(prog, "Attempted assignment to NULL entity field .%s (%i) in %s\n", PRVM_GetString(prog, PRVM_ED_FieldAtOfs(prog, OPB->_int)->s_name), (int)OPB->_int, prog->name);
+                                               VM_Warning(prog, "Attempted assignment to world.%s (edictnum 0 field %i) in %s\n", PRVM_GetString(prog, PRVM_ED_FieldAtOfs(prog, OPB->_int)->s_name), (int)OPB->_int, prog->name);
                                        }
                                }
                                ptr = (prvm_eval_t *)(cached_edictsfields + OPB->_int);
@@ -557,7 +557,7 @@ int i;
                                if (OPA->edict == 0 && !cached_allowworldwrites)
                                {
                                        PRE_ERROR();
-                                       prog->error_cmd("Forbidden assignment to NULL entity in %s", prog->name);
+                                       prog->error_cmd("Forbidden assignment to world (edictnum 0) in %s", prog->name);
                                        goto cleanup;
                                }
 #endif