]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Use correct droptofloor distance for each Quake map format
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 17 Jan 2023 05:09:04 +0000 (15:09 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 17 Jan 2023 05:09:37 +0000 (15:09 +1000)
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
clvm_cmds.c
sv_main.c
svvm_cmds.c

index 2a2cefa68a67f07024856b4f513eae87c56bbb55..1f394845215e56d0f3628abaf48244dece9f0e6d 100644 (file)
@@ -547,7 +547,12 @@ static void VM_CL_droptofloor (prvm_prog_t *prog)
        VectorCopy(PRVM_clientedictvector(ent, mins), mins);
        VectorCopy(PRVM_clientedictvector(ent, maxs), maxs);
        VectorCopy(PRVM_clientedictvector(ent, origin), end);
-       end[2] -= 256;
+       if (cl.worldmodel->brush.isq3bsp)
+               end[2] -= 4096;
+       else if (cl.worldmodel->brush.isq2bsp)
+               end[2] -= 128;
+       else
+               end[2] -= 256; // Quake, QuakeWorld
 
        trace = CL_TraceBox(start, mins, maxs, end, MOVE_NORMAL, ent, CL_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value, true, true, NULL, true);
 
index 891e8023cf50a0b2701e7a87e69d6297473146ce..1c3c6f816b3a91b0201e30b77f4f17638786fddc 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -205,7 +205,7 @@ cvar_t sv_autodemo_perclient_discardable = {CF_SERVER | CF_ARCHIVE, "sv_autodemo
 
 cvar_t halflifebsp = {CF_SERVER, "halflifebsp", "0", "indicates the current map is hlbsp format (useful to know because of different bounding box sizes)"};
 cvar_t sv_mapformat_is_quake2 = {CF_SERVER, "sv_mapformat_is_quake2", "0", "indicates the current map is q2bsp format (useful to know because of different entity behaviors, .frame on submodels and other things)"};
-cvar_t sv_mapformat_is_quake3 = {CF_SERVER, "sv_mapformat_is_quake3", "0", "indicates the current map is q2bsp format (useful to know because of different entity behaviors)"};
+cvar_t sv_mapformat_is_quake3 = {CF_SERVER, "sv_mapformat_is_quake3", "0", "indicates the current map is q3bsp format (useful to know because of different entity behaviors)"};
 
 cvar_t sv_writepicture_quality = {CF_SERVER | CF_ARCHIVE, "sv_writepicture_quality", "10", "WritePicture quality offset (higher means better quality, but slower)"};
 
index 672ff70d1f8e7116237d6f81737fe2b8012a014b..a884d0f1b42c47393300edc8e88d21df774becb6 100644 (file)
@@ -1158,7 +1158,12 @@ static void VM_SV_droptofloor(prvm_prog_t *prog)
        }
 
        VectorCopy (PRVM_serveredictvector(ent, origin), end);
-       end[2] -= 256;
+       if (sv.worldmodel->brush.isq3bsp)
+               end[2] -= 4096;
+       else if (sv.worldmodel->brush.isq2bsp)
+               end[2] -= 128;
+       else
+               end[2] -= 256; // Quake, QuakeWorld
 
        if (sv_gameplayfix_droptofloorstartsolid_nudgetocorrect.integer)
                SV_NudgeOutOfSolid(ent);