]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into bones_was_here/q3compat
authorbones_was_here <bones_was_here@yahoo.com.au>
Sun, 2 Aug 2020 06:02:52 +0000 (16:02 +1000)
committerbones_was_here <bones_was_here@yahoo.com.au>
Sun, 2 Aug 2020 06:02:52 +0000 (16:02 +1000)
20 files changed:
qcsrc/common/items/item/ammo.qc
qcsrc/common/mapobjects/func/button.qc
qcsrc/common/mapobjects/func/door.qc
qcsrc/common/mapobjects/trigger/hurt.qc
qcsrc/common/mapobjects/trigger/jumppads.qc
qcsrc/common/mapobjects/trigger/multi.qc
qcsrc/common/mutators/mutator/buffs/all.inc
qcsrc/common/physics/player.qc
qcsrc/common/stats.qh
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/shotgun.qh
qcsrc/server/autocvars.qh
qcsrc/server/client.qc
qcsrc/server/compat/quake.qc
qcsrc/server/compat/quake3.qc
qcsrc/server/compat/quake3.qh
qcsrc/server/g_world.qc
qcsrc/server/items/spawning.qc
xonotic-server.cfg

index 739d94aca1e8b3fb9954ce8a278570f96c6363cf..48ca0ddab6947f2dd320a96d5644983f4a055ee4 100644 (file)
@@ -1,14 +1,2 @@
 #include "ammo.qh"
 
-#ifdef SVQC
-
-METHOD(Shells, m_spawnfunc_hookreplace, GameItem(Shells this, entity e))
-{
-       if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
-       {
-               return ITEM_Bullets;
-       }
-       return this;
-}
-
-#endif
index 423ac5e7b6d927f9fa2f8cdd42cf9797fe6b2f56..c716b400c86985e1260faa8aeaad2f85ab8bbbb1 100644 (file)
@@ -206,8 +206,8 @@ spawnfunc(func_button)
        if (!this.lip)
                this.lip = 4;
 
-       if(this.wait == -1 && autocvar_sv_q3defragcompat)
-               this.wait = 0.1; // compatibility for q3df: "instant" return
+       if(this.wait < 0 && q3compat)
+               this.wait = 0.1; // compatibility for q3: -1 = return immediately
 
     if(this.noise != "")
         precache_sound(this.noise);
index 11196ab38d7f2bbcce2418a3bfd3f201be84bed4..48e11ad87bc528c3867b12312a7aa24c86f6710f 100644 (file)
@@ -737,7 +737,7 @@ spawnfunc(func_door)
         }
         else if (!this.speed)
         {
-               if (autocvar_sv_q3defragcompat)
+               if (q3compat)
                        this.speed = 400;
                else
                        this.speed = 100;
index 8c21c509c5643419bb937d1d4170a81d711f12df..19447c41b99d2f3b563264f75601b85d50a2eae0 100644 (file)
@@ -25,7 +25,7 @@ void trigger_hurt_touch(entity this, entity toucher)
                if (toucher.triggerhurttime < time)
                {
                        EXACTTRIGGER_TOUCH(this, toucher);
-                       toucher.triggerhurttime = time + ((autocvar_sv_q3defragcompat && !(this.spawnflags & HURT_SLOW)) ? 0.1 : 1);
+                       toucher.triggerhurttime = time + ((q3compat && !(this.spawnflags & HURT_SLOW)) ? 0.1 : 1);
 
                        entity own;
                        own = this.enemy;
@@ -66,7 +66,7 @@ spawnfunc(trigger_hurt)
        this.use = trigger_hurt_use;
        this.enemy = world; // I hate you all
        if (!this.dmg)
-               this.dmg = ((autocvar_sv_q3defragcompat) ? 5 : 10000);
+               this.dmg = ((q3compat) ? 5 : 10000);
        if (this.message == "")
                this.message = "was in the wrong place";
        if (this.message2 == "")
index b016dde9a19287d7e8c9e77ede292ee22c69c6cb..25be467807fa2404f55fc088cce2a484323e9531 100644 (file)
@@ -135,9 +135,9 @@ bool jumppad_push(entity this, entity targ)
 
        vector org = targ.origin;
 #ifdef SVQC
-       if(autocvar_sv_q3defragcompat)
+       if(q3compat)
 #elif defined(CSQC)
-       if(STAT(Q3DEFRAGCOMPAT))
+       if(STAT(Q3COMPAT))
 #endif
        {
                org.z += targ.mins_z;
index 9ce5f52cea877d9a1f556c9fa1ee88b06027fe08..407a75371c54cd90529d33a4741a43b4eae6fe3e 100644 (file)
@@ -167,7 +167,7 @@ spawnfunc(trigger_multiple)
                this.wait = 0;
        this.use = multi_use;
 
-       if(this.wait == -1 && autocvar_sv_q3defragcompat)
+       if(this.wait == -1 && (q3compat & BIT(1)))
                this.wait = 0.1; // compatibility for q3df: "instant" return
 
        EXACTTRIGGER_INIT;
index 5b53b3d651c2d76e49ac25e6778fc24a781e7fde..6fd7bdd9b32c2380766bf068975436ae6bbf603e 100644 (file)
@@ -2,12 +2,14 @@ string Buff_UndeprecateName(string buffname)
 {
     switch(buffname)
     {
-        case "ammoregen": return "ammo";
-        case "haste": case "scout": return "speed";
-        case "guard": return "resistance";
-        case "revival": case "regen": return "medic";
-        case "invis": return "invisible";
-        case "jumper": return "jump";
+        case "ammoregen": return "ammo";               // Q3TA ammoregen
+        case "haste": return "speed";                  // Q3A haste
+        case "doubler": return "inferno";              // Q3TA doubler
+        case "scout": return "bash";                   // Q3TA scout
+        case "guard": return "resistance";             // Q3TA guard
+        case "revival": case "regen": return "medic";  // WOP revival, Q3A regen
+        case "invis": return "invisible";              // Q3A invis
+        case "jumper": return "jump";                  // WOP jumper
         default: return buffname;
     }
 }
@@ -38,7 +40,6 @@ REGISTER_BUFF(SPEED) {
 }
 BUFF_SPAWNFUNCS(speed, BUFF_SPEED)
 BUFF_SPAWNFUNC_Q3TA_COMPAT(haste, BUFF_SPEED)
-BUFF_SPAWNFUNC_Q3TA_COMPAT(scout, BUFF_SPEED)
 
 REGISTER_BUFF(MEDIC) {
     this.m_name = _("Medic");
@@ -57,7 +58,7 @@ REGISTER_BUFF(BASH) {
     this.m_color = '1 0.39 0';
 }
 BUFF_SPAWNFUNCS(bash, BUFF_BASH)
-BUFF_SPAWNFUNC_Q3TA_COMPAT(doubler, BUFF_BASH)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(scout, BUFF_BASH)
 
 REGISTER_BUFF(VAMPIRE) {
     this.m_name = _("Vampire");
@@ -108,6 +109,7 @@ REGISTER_BUFF(INFERNO) {
     this.m_color = '1 0.62 0';
 }
 BUFF_SPAWNFUNCS(inferno, BUFF_INFERNO)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(doubler, BUFF_INFERNO)
 
 REGISTER_BUFF(SWAPPER) {
     this.m_name = _("Swapper");
index 76bfb0334a9df8fe25f79cc7971fe78101cb8fae..1d89f687f70926f14e192004050e968846f638cc 100644 (file)
@@ -54,13 +54,13 @@ void Physics_UpdateStats(entity this)
             : 0;
           STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, this) = Physics_ClientOption(this, "airspeedlimit_nonqw", autocvar_sv_airspeedlimit_nonqw) * maxspd_mod;
         }
-       bool q3dfcompat = autocvar_sv_q3defragcompat && autocvar_sv_q3defragcompat_changehitbox; // NOTE: these hitboxes are off by 1 due to engine differences
-       STAT(PL_MIN, this) = (q3dfcompat) ? '-15 -15 -20' : autocvar_sv_player_mins;
-       STAT(PL_MAX, this) = (q3dfcompat) ? '15 15 36' : autocvar_sv_player_maxs;
-       STAT(PL_VIEW_OFS, this) = (q3dfcompat) ? '0 0 30' : autocvar_sv_player_viewoffset;
-       STAT(PL_CROUCH_MIN, this) = (q3dfcompat) ? '-15 -15 -20' : autocvar_sv_player_crouch_mins;
-       STAT(PL_CROUCH_MAX, this) = (q3dfcompat) ? '15 15 20' : autocvar_sv_player_crouch_maxs;
-       STAT(PL_CROUCH_VIEW_OFS, this) = (q3dfcompat) ? '0 0 16' : autocvar_sv_player_crouch_viewoffset;
+       bool q3hb = q3compat && autocvar_sv_q3compat_changehitbox; // NOTE: these hitboxes are off by 1 due to engine differences
+       STAT(PL_MIN, this) = (q3hb) ? '-15 -15 -20' : autocvar_sv_player_mins;
+       STAT(PL_MAX, this) = (q3hb) ? '15 15 36' : autocvar_sv_player_maxs;
+       STAT(PL_VIEW_OFS, this) = (q3hb) ? '0 0 30' : autocvar_sv_player_viewoffset;
+       STAT(PL_CROUCH_MIN, this) = (q3hb) ? '-15 -15 -20' : autocvar_sv_player_crouch_mins;
+       STAT(PL_CROUCH_MAX, this) = (q3hb) ? '15 15 20' : autocvar_sv_player_crouch_maxs;
+       STAT(PL_CROUCH_VIEW_OFS, this) = (q3hb) ? '0 0 16' : autocvar_sv_player_crouch_viewoffset;
 
        // old stats
        // fix some new settings
index 5bbc4dd26317ff9a663fee894fbeef2e5398dd67..e1aba4caa4f0620b2c0385e5f6f2172ec612d787 100644 (file)
@@ -3,6 +3,7 @@
 #ifdef SVQC
 #include <server/autocvars.qh>
 #include <server/client.qh>
+#include <server/compat/quake3.qh>
 #include <common/mapobjects/trigger/secret.qh>
 #endif
 
@@ -324,10 +325,7 @@ bool autocvar_sv_slick_applygravity;
 #endif
 REGISTER_STAT(SLICK_APPLYGRAVITY, bool, autocvar_sv_slick_applygravity)
 
-#ifdef SVQC
-bool autocvar_sv_q3defragcompat;
-#endif
-REGISTER_STAT(Q3DEFRAGCOMPAT, bool, autocvar_sv_q3defragcompat)
+REGISTER_STAT(Q3COMPAT, int, q3compat)
 
 #ifdef SVQC
 #include "physics/movetypes/movetypes.qh"
index f38c34b19791182d9127b58a6459d12d8cc332db..4ee49f83b0f4e31acd06e3175c7ce3ad3339fa1a 100644 (file)
@@ -3,18 +3,6 @@
 REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE)
 
 #ifdef SVQC
-// enable when shockwave replaces shotgun
-#if 0
-METHOD(Shockwave, m_spawnfunc_hookreplace, Weapon(Shockwave this, entity e))
-{
-       //if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO
-       if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
-       {
-               return WEP_MACHINEGUN;
-       }
-       return this;
-}
-#endif
 
 const float MAX_SHOCKWAVE_HITS = 10;
 //#define DEBUG_SHOCKWAVE
index 3e25800cce5a69119e3073358f1822ac87d4c04c..1f3fcc32f297f7032f1583884711e28eb0683804 100644 (file)
@@ -5,15 +5,6 @@
 // enable to debug melee range
 //#define SHOTGUN_MELEEDEBUG
 
-METHOD(Shotgun, m_spawnfunc_hookreplace, Weapon(Shotgun this, entity e))
-{
-       if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
-       {
-               return WEP_MACHINEGUN;
-       }
-       return this;
-}
-
 void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float isprimary, float ammocount, float damage, float bullets, float spread, float solidpenetration, float force, entity bullet_trail_effect)
 {
        W_DecreaseAmmo(thiswep, actor, ammocount, weaponentity);
index 1c2d280102af276cdbca8e18baab892ca9910f61..d99a371f34cbcd593aabb50cd789d136ab320e2e 100644 (file)
@@ -56,4 +56,3 @@ CLASS(Shotgun, Weapon)
 ENDCLASS(Shotgun)
 REGISTER_WEAPON(SHOTGUN, shotgun, NEW(Shotgun));
 
-SPAWNFUNC_WEAPON(weapon_shotgun, WEP_SHOTGUN)
index 99077dcfe7b237fc8e1c5e59f888e6d666c4feb5..16a8b91aa4bb218eae56c3a40f9ab40e06494747 100644 (file)
@@ -327,7 +327,6 @@ float autocvar_sv_maxspeed;
 string autocvar_sv_motd;
 int autocvar_sv_name_maxlength = 64;
 bool autocvar_sv_precacheplayermodels;
-bool autocvar_sv_q3acompat_machineshotgunswap;
 bool autocvar_sv_servermodelsonly;
 int autocvar_sv_spectate;
 float autocvar_sv_spectator_speed_multiplier;
@@ -533,4 +532,4 @@ bool autocvar_sv_showspectators;
 bool autocvar_g_weaponswitch_debug;
 bool autocvar_g_weaponswitch_debug_alternate;
 bool autocvar_g_allow_checkpoints;
-bool autocvar_sv_q3defragcompat_changehitbox = false;
+bool autocvar_sv_q3compat_changehitbox;
index 0458b07af332d3b9f6b6d2d2c0ffdd3b4741ca7a..d3cc3d3fed2f5928276d272167d5e68c3b03682d 100644 (file)
@@ -614,8 +614,7 @@ void PutPlayerInServer(entity this)
        this.respawn_flags = 0;
        this.respawn_time = 0;
        STAT(RESPAWN_TIME, this) = 0;
-       bool q3dfcompat = autocvar_sv_q3defragcompat && autocvar_sv_q3defragcompat_changehitbox;
-       this.scale = ((q3dfcompat) ? 0.9 : autocvar_sv_player_scale);
+       this.scale = ((q3compat && autocvar_sv_q3compat_changehitbox) ? 0.9 : autocvar_sv_player_scale);
        this.fade_time = 0;
        this.pain_frame = 0;
        this.pain_finished = 0;
index c80da0af3772cf40ddd744cf1c471f0268702e23..e8f1fdea2a033cf94875dfbe41837f8f50d7f2f8 100644 (file)
@@ -4,15 +4,17 @@
 #include <server/miscfunctions.qh>
 #include <common/weapons/_all.qh>
 
-//***********************
-//QUAKE 1 ENTITIES - So people can play quake1 maps with the xonotic weapons
-//***********************
-SPAWNFUNC_WEAPON(weapon_nailgun, WEP_ELECTRO)
+/***********************
+ * QUAKE 1 ENTITIES - So people can play quake1 maps with the xonotic weapons
+ ***********************
+ weapon_nailgun handled in quake3.qc
+ item_armor1 handled in items.qc
+*/
+
 SPAWNFUNC_WEAPON(weapon_supernailgun, WEP_HAGAR)
 SPAWNFUNC_WEAPON(weapon_supershotgun, WEP_MACHINEGUN)
 
 SPAWNFUNC_ITEM(item_spikes, ITEM_Bullets)
-//spawnfunc(item_armor1) {spawnfunc_item_armor_medium(this);}  // FIXME: in Quake this is green armor, in Xonotic maps it is an armor shard
 SPAWNFUNC_ITEM(item_armor2, ITEM_ArmorMega)
 SPAWNFUNC_ITEM(item_armorInv, ITEM_ArmorMega) // TODO: make sure we actually want this
 SPAWNFUNC_ITEM_COND(item_health, (this.spawnflags & 2), ITEM_HealthMega, ITEM_HealthMedium)
index 4c8073b1ad35cfbef5d393d9ebdaf9d6532ef338..11b9f7188c8164661655a79b4e658295fe9bd621 100644 (file)
 #include <common/notifications/all.qh>
 #include <common/weapons/_all.qh>
 
-//***********************
-//QUAKE 3 ENTITIES - So people can play quake3 maps with the xonotic weapons
-//***********************
-
-// NOTE: for best experience, you need to swap MGs with SGs in the map or it won't have a MG
-
-// SG -> SG
-SPAWNFUNC_ITEM(ammo_shells, ITEM_Shells)
-
-// MG -> MG
-SPAWNFUNC_ITEM(ammo_bullets, ITEM_Bullets)
+/***********************
+ * QUAKE 3 ENTITIES - So people can play quake3 maps with the xonotic weapons
+ ***********************
+
+ * Map entities NOT handled in this file:
+ holdable_invulnerability      Q3TA    currently unsupported
+ holdable_kamikaze             Q3TA    currently unsupported
+ item_ammoregen                        Q3TA    handled by buffs mutator
+ item_doubler                  Q3TA    handled by buffs mutator
+ item_guard                    Q3TA    handled by buffs mutator
+ item_scout                    Q3TA    handled by buffs mutator
+ item_armor_jacket             CPMA    handled in quake2.qc
+ item_flight                   Q3A     handled by buffs mutator
+ item_haste                    Q3A     handled by buffs mutator
+ item_health                   Q3A     handled in quake.qc
+ item_health_large             Q3A     handled in items.qc
+ item_health_small             Q3A     handled in health.qh
+ item_health_mega              Q3A     handled in health.qh
+ item_invis                    Q3A     handled by buffs mutator
+ item_quad                     Q3A     handled in items.qc
+ item_regen                    Q3A     handled by buffs mutator
+ CTF spawnfuncs handled in sv_ctf.qc
+
+ NOTE: for best experience, you need to swap MGs with SGs in the map or it won't have a MG
+*/
+
+// SG -> MG || SG
+SPAWNFUNC_ITEM_COND(ammo_shells, (q3compat & BIT(0)), ITEM_Bullets, ITEM_Shells)
+SPAWNFUNC_WEAPON_COND(weapon_shotgun, (q3compat & BIT(0)), WEP_MACHINEGUN, WEP_SHOTGUN)
+
+// MG -> SG || MG
+SPAWNFUNC_ITEM_COND(ammo_bullets, (q3compat & BIT(0)), ITEM_Shells, ITEM_Bullets)
 
 // GL -> Mortar
 SPAWNFUNC_ITEM(ammo_grenades, ITEM_Rockets)
 
-// Mines -> Rockets
+// Team Arena Proximity Launcher -> Mine Layer
 SPAWNFUNC_WEAPON(weapon_prox_launcher, WEP_MINE_LAYER)
 SPAWNFUNC_ITEM(ammo_mines, ITEM_Rockets)
 
-// LG -> Lightning
+// Team Arena Chaingun -> HLAC
+SPAWNFUNC_WEAPON(weapon_chaingun, WEP_HLAC)
+SPAWNFUNC_ITEM(ammo_belt, ITEM_Cells)
+
+// Team Arena Nailgun -> Crylink || Quake Nailgun -> Electro
+SPAWNFUNC_WEAPON_COND(weapon_nailgun, cvar("sv_mapformat_is_quake3"), WEP_CRYLINK, WEP_ELECTRO)
+SPAWNFUNC_ITEM(ammo_nails, ITEM_Cells)
+
+// LG -> Electro
 SPAWNFUNC_WEAPON(weapon_lightning, WEP_ELECTRO)
 SPAWNFUNC_ITEM(ammo_lightning, ITEM_Cells)
 
@@ -44,9 +73,9 @@ SPAWNFUNC_ITEM(ammo_cells, ITEM_Rockets)
 SPAWNFUNC_WEAPON(weapon_railgun, WEP_VORTEX)
 SPAWNFUNC_ITEM(ammo_slugs, ITEM_Cells)
 
-// BFG -> Crylink
-SPAWNFUNC_WEAPON(weapon_bfg, WEP_CRYLINK)
-SPAWNFUNC_ITEM(ammo_bfg, ITEM_Cells)
+// BFG -> Crylink || Fireball
+SPAWNFUNC_WEAPON_COND(weapon_bfg, cvar_string("g_mod_balance") == "XDF", WEP_CRYLINK, WEP_FIREBALL)
+SPAWNFUNC_ITEM_COND(ammo_bfg, cvar_string("g_mod_balance") == "XDF", ITEM_Cells, ITEM_Rockets)
 
 // grappling hook -> hook
 SPAWNFUNC_WEAPON(weapon_grapplinghook, WEP_HOOK)
@@ -58,6 +87,9 @@ SPAWNFUNC_ITEM(ammo_rockets, ITEM_Rockets)
 SPAWNFUNC_ITEM(item_armor_body, ITEM_ArmorMega)
 SPAWNFUNC_ITEM(item_armor_combat, ITEM_ArmorBig)
 SPAWNFUNC_ITEM(item_armor_shard, ITEM_ArmorSmall)
+SPAWNFUNC_ITEM(item_armor_green, ITEM_ArmorMedium) // CCTF
+
+// Battle Suit
 SPAWNFUNC_ITEM(item_enviro, ITEM_Shield)
 
 // medkit -> armor (we have no holdables)
@@ -245,35 +277,31 @@ spawnfunc(target_fragsFilter)
        this.use = fragsfilter_use;
 }
 
-//spawnfunc(item_flight)       /* handled by buffs mutator */
-//spawnfunc(item_doubler)        /* handled by buffs mutator */
-//spawnfunc(item_haste)        /* handled by buffs mutator */
-//spawnfunc(item_health)       /* handled in t_quake.qc */
-//spawnfunc(item_health_large) /* handled in items.qc */
-//spawnfunc(item_health_small) /* handled in items.qc */
-//spawnfunc(item_health_mega)  /* handled in items.qc */
-//spawnfunc(item_invis)        /* handled by buffs mutator */
-//spawnfunc(item_regen)        /* handled by buffs mutator */
-
-// CTF spawnfuncs handled in mutators/gamemode_ctf.qc now
-
-.float notteam;
-.float notsingle;
-.float notfree;
-.float notq3a;
-.float notta;
+.bool notteam;
+.bool notsingle;
+.bool notfree;
+.bool notta;
+.bool notvq3;
+.bool notcpm;
 .string gametype;
 bool DoesQ3ARemoveThisEntity(entity this)
 {
        // Q3 style filters (DO NOT USE, THIS IS COMPAT ONLY)
 
-       if(this.notq3a)
-               if(!teamplay || g_tdm || g_ctf)
+       // DeFRaG mappers use "notcpm" or "notvq3" to disable an entity in CPM or VQ3 physics
+       // Xonotic is usually played with a CPM-based physics so we default to CPM mode
+       if(cvar_string("g_mod_physics") == "Q3")
+       {
+               if(this.notvq3)
                        return true;
+       }
+       else if(this.notcpm)
+               return true;
 
+       // Q3 mappers use "notq3a" or "notta" to disable an entity in Q3A or Q3TA
+       // Xonotic has ~equivalent features to Team Arena
        if(this.notta)
-               if (!(!teamplay || g_tdm || g_ctf))
-                       return true;
+               return true;
 
        if(this.notsingle)
                if(maxclients == 1)
@@ -290,7 +318,7 @@ bool DoesQ3ARemoveThisEntity(entity this)
        if(this.gametype)
        {
                string gametypename;
-               // static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"}
+               // From ioq3 g_spawn.c: static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester"};
                gametypename = "ffa";
                if(teamplay)
                        gametypename = "team";
@@ -302,7 +330,7 @@ bool DoesQ3ARemoveThisEntity(entity this)
                        gametypename = "tournament";
                if(maxclients == 1)
                        gametypename = "single";
-               // we do not have the other types (obelisk, harvester, teamtournament)
+               // we do not have the other types (obelisk, harvester)
                if(strstrofs(this.gametype, gametypename, 0) < 0)
                        return true;
        }
index 20e4879d9a37596290a2a24258a7d69db623e21a..5d759e3783e4f1ee4dc8e036f2ce6c470fe648e5 100644 (file)
@@ -1,5 +1,6 @@
 #pragma once
 
+int q3compat = 0;
 bool DoesQ3ARemoveThisEntity(entity this);
 
 .int fragsfilter_cnt;
index 5dddc2fb3d00924ec3e257d83717c672ace9c1e4..3ade3ce84b7d4495907bb086c900b496bc2868ee 100644 (file)
@@ -883,11 +883,8 @@ spawnfunc(worldspawn)
        MapInfo_Enumerate();
        MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1);
 
-       if(fexists(strcat("scripts/", mapname, ".arena")))
-               cvar_settemp("sv_q3acompat_machineshotgunswap", "1");
-
-       if(fexists(strcat("scripts/", mapname, ".defi")))
-               cvar_settemp("sv_q3defragcompat", "1");
+       q3compat = BITSET(q3compat, BIT(0), fexists(strcat("scripts/", mapname, ".arena")));
+       q3compat = BITSET(q3compat, BIT(1), fexists(strcat("scripts/", mapname, ".defi")));
 
        if(whichpack(strcat("maps/", mapname, ".cfg")) != "")
        {
index f1c8796c7211ece944ef334be60266c8a661e7b4..829e6914116ca4cd6aaa6f856ddb7b5529d42f9e 100644 (file)
@@ -131,8 +131,7 @@ void Item_SetExpiring(entity item, bool expiring)
 
 // Compatibility spawn functions
 
-// FIXME: in Quake this is green armor, in Xonotic maps it is an armor shard
-SPAWNFUNC_ITEM(item_armor1, ITEM_ArmorSmall)
+SPAWNFUNC_ITEM_COND(item_armor1, cvar("sv_mapformat_is_quake3"), ITEM_ArmorSmall, ITEM_ArmorMedium)
 
 SPAWNFUNC_ITEM(item_armor25, ITEM_ArmorMega)
 
index 85923c8ea5817c5eb3c8ac7ea088add4452c8e56..6e34c767438f200dbf69edac158fada9f448edba 100644 (file)
@@ -496,8 +496,7 @@ sv_gameplayfix_consistentplayerprethink 1
 sv_gameplayfix_gravityunaffectedbyticrate 1
 sv_gameplayfix_nogravityonground 1
 
-set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping machinegun and shotgun (for Q3A map compatibility in mapinfo files)"
-set sv_q3defragcompat 0 "toggle for some compatibility hacks (for Q3DF map compatibility)"
+set sv_q3compat_changehitbox 0 "use Q3 player hitbox dimensions and camera height on Q3 maps (maps with an entry in a .arena or .defi file)
 
 set g_movement_highspeed 1 "multiplier scale for movement speed (applies to sv_maxspeed and sv_maxairspeed, also applies to air acceleration when g_movement_highspeed_q3_compat is set to 0)"
 set g_movement_highspeed_q3_compat 0 "apply speed modifiers to air movement in a more Q3-compatible way (only apply speed buffs and g_movement_highspeed to max air speed, not to acceleration)"