Merge branch 'Mario/weapon_alias_fix' into 'master'
authorLegendaryGuard <rootuser999@gmail.com>
Thu, 7 Jul 2022 22:59:42 +0000 (22:59 +0000)
committerLegendaryGuard <rootuser999@gmail.com>
Thu, 7 Jul 2022 22:59:42 +0000 (22:59 +0000)
Merge branch Mario/weapon_alias_fix (XS merge request)

Closes #2714

See merge request xonotic/xonotic-data.pk3dir!1052

.gitlab-ci.yml
qcsrc/common/weapons/all.inc
qcsrc/common/weapons/all.qh

index 8b56b81ff39f4e9dda7e29a01cca19b8d679fd06..87bb7bb07c412caf7368bec7950418fa7f2eb4b2 100644 (file)
@@ -55,7 +55,7 @@ test_sv_game:
     - wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints\r
     - wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache\r
 \r
-    - EXPECT=8e36763a3b4590356bcc449b2452d0ea\r
+    - EXPECT=458e9e611a757c745da05c85a37e576d\r
     - HASH=$(${ENGINE} +timestamps 1 +exec serverbench.cfg\r
       | tee /dev/stderr\r
       | sed -e 's,^\[[^]]*\] ,,'\r
index 4da01579f19b55edbf4f22a89d609e4420263047..15e61025b7f03da9ede755c321a619d2865ccf3b 100644 (file)
@@ -25,3 +25,7 @@
 #include "weapon/seeker.qh"
 #include "weapon/shockwave.qh"
 #include "weapon/arc.qh"
+
+// Weapon registry is sorted to allocate the weapons included above first, update the value below to the number of listed weapons
+// TODO: remove eventually in a way that does not cause https://gitlab.com/xonotic/xonotic-data.pk3dir/-/issues/2714
+#define WEP_HARDCODED_IMPULSES 20
index 356c3882a920d84537261cbc8b9acb9ba7b26be2..286b7a3d3dbfdde33e21975131c2214a691082c6 100644 (file)
@@ -308,11 +308,11 @@ WepSet WEPSET_SUPERWEAPONS;
 
 #include "all.inc"
 
-// TODO: invert after 0.8.2. Will require moving 'best weapon' impulses
+// TODO: invert after changes have been made to the hardcoded weapon impulses. Will require moving 'best weapon' impulses
 #define WEP_IMPULSE_BEGIN 230
 #define WEP_IMPULSE_END bound(WEP_IMPULSE_BEGIN, WEP_IMPULSE_BEGIN + (REGISTRY_COUNT(Weapons) - 1) - 1, 253)
 
-REGISTRY_SORT(Weapons, 1)
+REGISTRY_SORT(Weapons, WEP_HARDCODED_IMPULSES + 1)
 REGISTRY_CHECK(Weapons)
 
 STATIC_INIT(register_weapons_done)
@@ -329,7 +329,7 @@ STATIC_INIT(register_weapons_done)
         else
                inaccessible = strcat(inaccessible, "\n", it.netname);
     });
-    if (inaccessible && autocvar_developer > 0) LOG_TRACEF("Impulse limit exceeded, weapon(s) will not be directly accessible: %s", inaccessible);
+    if (inaccessible != "" && autocvar_developer > 0) LOG_TRACEF("Impulse limit exceeded, weapon(s) will not be directly accessible: %s", inaccessible);
     #ifdef CSQC
     FOREACH(Weapons, true, it.wr_init(it));
     #endif