]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use correct droptofloor distance for each Quake map format
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 17 Jan 2023 04:42:11 +0000 (14:42 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 17 Jan 2023 05:09:47 +0000 (15:09 +1000)
Fixes #2800

qcsrc/server/compat/quake3.qc
qcsrc/server/items/spawning.qc
qcsrc/server/world.qc
qcsrc/server/world.qh

index 911ab0f815534dfcebd5e10c35ab7ed658be0d72..9333ebfed50973872e0c0111aba93b4886cde5eb 100644 (file)
@@ -66,7 +66,7 @@ SPAWNFUNC_Q3(weapon_chaingun, ammo_belt, WEP_HLAC)
 SPAWNFUNC_Q3(weapon_hmg, ammo_hmg, WEP_HLAC)
 
 // Team Arena Nailgun -> Crylink || Quake Nailgun -> Electro
-SPAWNFUNC_Q3_COND(weapon_nailgun, ammo_nails, cvar("sv_mapformat_is_quake3"), WEP_CRYLINK, WEP_ELECTRO)
+SPAWNFUNC_Q3_COND(weapon_nailgun, ammo_nails, autocvar_sv_mapformat_is_quake3, WEP_CRYLINK, WEP_ELECTRO)
 
 // LG -> Electro
 SPAWNFUNC_Q3(weapon_lightning, ammo_lightning, WEP_ELECTRO)
index bc780da552677418eb14e3e5943d3e678085626d..a1789e9dcc878be4a4599546c6d7663d306801c3 100644 (file)
@@ -146,7 +146,7 @@ void Item_SetExpiring(entity item, bool expiring)
 // Compatibility spawn functions
 
 // in Quake this is green armor, in Xonotic maps it is an armor shard
-SPAWNFUNC_ITEM_COND(item_armor1, cvar("sv_mapformat_is_quake3"), ITEM_ArmorSmall, ITEM_ArmorMedium)
+SPAWNFUNC_ITEM_COND(item_armor1, autocvar_sv_mapformat_is_quake3, ITEM_ArmorSmall, ITEM_ArmorMedium)
 
 SPAWNFUNC_ITEM(item_armor25, ITEM_ArmorMega)
 
index 18d41827ba21aac05e371813f414aeb79c48c142..cfaec58e38cd5dc17413cfa28b1d5d497d5c2d34 100644 (file)
@@ -2263,7 +2263,13 @@ void DropToFloor_Handler(entity this)
                return;
        }
 
-       vector end = this.origin - '0 0 256';
+       vector end = this.origin;
+       if (autocvar_sv_mapformat_is_quake3)
+               end.z -= 4096;
+       else if (autocvar_sv_mapformat_is_quake2)
+               end.z -= 128;
+       else
+               end.z -= 256; // Quake, QuakeWorld
 
        // NOTE: SV_NudgeOutOfSolid is used in the engine here
        if(autocvar_sv_gameplayfix_droptofloorstartsolid_nudgetocorrect)
index 271f394adaa91c84f801a48db1856032781ca485..06c5f5a2be3a3c0701990d5a5f7eb3baddc70a32 100644 (file)
@@ -30,6 +30,9 @@ float autocvar_timelimit_suddendeath;
 bool autocvar_sv_gameplayfix_droptofloorstartsolid;
 bool autocvar_sv_gameplayfix_droptofloorstartsolid_nudgetocorrect;
 
+bool autocvar_sv_mapformat_is_quake3;
+bool autocvar_sv_mapformat_is_quake2;
+
 float checkrules_equality;
 float checkrules_suddendeathwarning;
 float checkrules_suddendeathend;