]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
droptofloor(): fix collisions between entities, including on id1 maps
authorbones_was_here <bones_was_here@xonotic.au>
Sat, 15 Jul 2023 12:28:23 +0000 (22:28 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sat, 15 Jul 2023 12:28:23 +0000 (22:28 +1000)
The presence of a monster bbox shouldn't cause a health to be considered
"in solid".

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

index bb26170012cb22c7f0b73493b3aa290994e73767..b3992c47fd630f28e8cc74852e1d3a9a9847f90d 100644 (file)
@@ -1219,16 +1219,23 @@ static void VM_SV_droptofloor(prvm_prog_t *prog)
                        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)));
        }
 
+       /* bones_was_here: not using SV_GenericHitSuperContentsMask(ent) anymore because it was setting:
+        * items:    SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY
+        * monsters: SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP
+        * explobox: SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_CORPSE
+        * which caused (startsolid == true) when, for example, a health was touching a monster.
+        * Changing MOVE_NORMAL also fixes that, but other engines are using MOVE_NORMAL here.
+        */
        VectorCopy(PRVM_serveredictvector(ent, origin), entorigin);
        VectorCopy(PRVM_serveredictvector(ent, mins), entmins);
        VectorCopy(PRVM_serveredictvector(ent, maxs), entmaxs);
-       trace = SV_TraceBox(entorigin, entmins, entmaxs, end, MOVE_NORMAL, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value);
+       trace = SV_TraceBox(entorigin, entmins, entmaxs, end, MOVE_NORMAL, ent, SUPERCONTENTS_SOLID, 0, 0, collision_extendmovelength.value);
        if (trace.startsolid && sv_gameplayfix_droptofloorstartsolid.integer)
        {
                vec3_t offset, org;
                VectorSet(offset, 0.5f * (PRVM_serveredictvector(ent, mins)[0] + PRVM_serveredictvector(ent, maxs)[0]), 0.5f * (PRVM_serveredictvector(ent, mins)[1] + PRVM_serveredictvector(ent, maxs)[1]), PRVM_serveredictvector(ent, mins)[2]);
                VectorAdd(PRVM_serveredictvector(ent, origin), offset, org);
-               trace = SV_TraceLine(org, end, MOVE_NORMAL, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value);
+               trace = SV_TraceLine(org, end, MOVE_NORMAL, ent, SUPERCONTENTS_SOLID, 0, 0, collision_extendmovelength.value);
                VectorSubtract(trace.endpos, offset, trace.endpos);
                if (trace.startsolid)
                {