]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use readable labels for q3compat bits
authorbones_was_here <bones_was_here@yahoo.com.au>
Mon, 10 Aug 2020 06:50:38 +0000 (16:50 +1000)
committerbones_was_here <bones_was_here@yahoo.com.au>
Mon, 10 Aug 2020 06:50:38 +0000 (16:50 +1000)
qcsrc/common/mapobjects/trigger/multi.qc
qcsrc/server/compat/quake3.qc
qcsrc/server/compat/quake3.qh
qcsrc/server/world.qc

index 407a75371c54cd90529d33a4741a43b4eae6fe3e..3887d7cacde77ad50331939fb03e5fbfb595f01d 100644 (file)
@@ -167,7 +167,7 @@ spawnfunc(trigger_multiple)
                this.wait = 0;
        this.use = multi_use;
 
-       if(this.wait == -1 && (q3compat & BIT(1)))
+       if(this.wait == -1 && (q3compat & Q3COMPAT_DEFI))
                this.wait = 0.1; // compatibility for q3df: "instant" return
 
        EXACTTRIGGER_INIT;
index b1db26e822f08ea860b067c8471a090012f94d1d..99f2fbec0fced0c5513f26c896d9d6e2d397447e 100644 (file)
 */
 
 // 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)
+SPAWNFUNC_ITEM_COND(ammo_shells, (q3compat & Q3COMPAT_ARENA), ITEM_Bullets, ITEM_Shells)
+SPAWNFUNC_WEAPON_COND(weapon_shotgun, (q3compat & Q3COMPAT_ARENA), WEP_MACHINEGUN, WEP_SHOTGUN)
 
 // MG -> SG || MG
-SPAWNFUNC_ITEM_COND(ammo_bullets, (q3compat & BIT(0)), ITEM_Shells, ITEM_Bullets)
+SPAWNFUNC_ITEM_COND(ammo_bullets, (q3compat & Q3COMPAT_ARENA), ITEM_Shells, ITEM_Bullets)
 
 // GL -> Mortar
 SPAWNFUNC_ITEM(ammo_grenades, ITEM_Rockets)
index 5d759e3783e4f1ee4dc8e036f2ce6c470fe648e5..7830446530722d25dd5e3867052daba2312bef25 100644 (file)
@@ -1,6 +1,9 @@
 #pragma once
 
 int q3compat = 0;
+#define Q3COMPAT_ARENA BIT(0)
+#define Q3COMPAT_DEFI BIT(1)
+
 bool DoesQ3ARemoveThisEntity(entity this);
 
 .int fragsfilter_cnt;
index 28c273a118dccfb5b7b3e9051ae8539a15f93939..1883177025be2db4ddaaa21b7c2360d79b52fad8 100644 (file)
@@ -887,8 +887,8 @@ spawnfunc(worldspawn)
        MapInfo_Enumerate();
        MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1);
 
-       q3compat = BITSET(q3compat, BIT(0), fexists(strcat("scripts/", mapname, ".arena")));
-       q3compat = BITSET(q3compat, BIT(1), fexists(strcat("scripts/", mapname, ".defi")));
+       q3compat = BITSET(q3compat, Q3COMPAT_ARENA, fexists(strcat("scripts/", mapname, ".arena")));
+       q3compat = BITSET(q3compat, Q3COMPAT_DEFI, fexists(strcat("scripts/", mapname, ".defi")));
 
        if(whichpack(strcat("maps/", mapname, ".cfg")) != "")
        {