]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
droptofloor(): add/improve warnings for badly placed entities
authorbones_was_here <bones_was_here@xonotic.au>
Sat, 15 Jul 2023 12:27:48 +0000 (22:27 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sat, 15 Jul 2023 12:27:48 +0000 (22:27 +1000)
In the past, sv_gameplayfix_droptofloorstartsolid and
sv_gameplayfix_droptofloorstartsolid_nudgetocorrect were enabled by
default when playing Quake, which seems to have led to some maps
depending on them.

These need to be off by default in Quake to avoid gameplay changes,
but we can at least warn people about map entity issues.

See: 34e819a626f6a7ff2ad190a8e7d42e38ca8cef0e

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
svvm_cmds.c

index 25e8798296113768ef5c4069433b285dc1c34f59..bb26170012cb22c7f0b73493b3aa290994e73767 100644 (file)
@@ -1211,7 +1211,13 @@ static void VM_SV_droptofloor(prvm_prog_t *prog)
                end[2] -= 256; // Quake, QuakeWorld
 
        if (sv_gameplayfix_droptofloorstartsolid_nudgetocorrect.integer)
-               PHYS_NudgeOutOfSolid(prog, ent);
+       {
+               int n = PHYS_NudgeOutOfSolid(prog, ent);
+               if (!n)
+                       VM_Warning(prog, "droptofloor at \"%f %f %f\": sv_gameplayfix_droptofloorstartsolid_nudgetocorrect COULD NOT FIX badly placed entity \"%s\" before drop\n", PRVM_gameedictvector(ent, origin)[0], PRVM_gameedictvector(ent, origin)[1], PRVM_gameedictvector(ent, origin)[2], PRVM_GetString(prog, PRVM_gameedictstring(ent, classname)));
+               else if (n > 0)
+                       VM_Warning(prog, "droptofloor at \"%f %f %f\": sv_gameplayfix_droptofloorstartsolid_nudgetocorrect FIXED badly placed entity \"%s\" before drop\n", PRVM_gameedictvector(ent, origin)[0], PRVM_gameedictvector(ent, origin)[1], PRVM_gameedictvector(ent, origin)[2], PRVM_GetString(prog, PRVM_gameedictstring(ent, classname)));
+       }
 
        VectorCopy(PRVM_serveredictvector(ent, origin), entorigin);
        VectorCopy(PRVM_serveredictvector(ent, mins), entmins);
@@ -1226,7 +1232,7 @@ static void VM_SV_droptofloor(prvm_prog_t *prog)
                VectorSubtract(trace.endpos, offset, trace.endpos);
                if (trace.startsolid)
                {
-                       Con_DPrintf("droptofloor at %f %f %f - COULD NOT FIX BADLY PLACED ENTITY\n", PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2]);
+                       VM_Warning(prog, "droptofloor at \"%f %f %f\": sv_gameplayfix_droptofloorstartsolid COULD NOT FIX badly placed entity \"%s\"\n", PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2], PRVM_GetString(prog, PRVM_gameedictstring(ent, classname)));
                        SV_LinkEdict(ent);
                        PRVM_serveredictfloat(ent, flags) = (int)PRVM_serveredictfloat(ent, flags) | FL_ONGROUND;
                        PRVM_serveredictedict(ent, groundentity) = 0;
@@ -1234,7 +1240,7 @@ static void VM_SV_droptofloor(prvm_prog_t *prog)
                }
                else if (trace.fraction < 1)
                {
-                       Con_DPrintf("droptofloor at %f %f %f - FIXED BADLY PLACED ENTITY\n", PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2]);
+                       VM_Warning(prog, "droptofloor at \"%f %f %f\": sv_gameplayfix_droptofloorstartsolid FIXED badly placed entity \"%s\"\n", PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2], PRVM_GetString(prog, PRVM_gameedictstring(ent, classname)));
                        VectorCopy (trace.endpos, PRVM_serveredictvector(ent, origin));
                        if (sv_gameplayfix_droptofloorstartsolid_nudgetocorrect.integer)
                                PHYS_NudgeOutOfSolid(prog, ent);
@@ -1248,6 +1254,9 @@ static void VM_SV_droptofloor(prvm_prog_t *prog)
        }
        else
        {
+               if (trace.startsolid)
+                       VM_Warning(prog, "droptofloor at \"%f %f %f\": badly placed entity \"%s\", startsolid: %d allsolid: %d\n", PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2], PRVM_GetString(prog, PRVM_gameedictstring(ent, classname)), trace.startsolid, trace.allsolid);
+
                if (!trace.allsolid && trace.fraction < 1)
                {
                        VectorCopy (trace.endpos, PRVM_serveredictvector(ent, origin));