Merge remote-tracking branch 'origin/master' into TimePath/guide
authorotta8634 <k9wolf@pm.me>
Sat, 14 Dec 2024 10:51:38 +0000 (18:51 +0800)
committerotta8634 <k9wolf@pm.me>
Sat, 14 Dec 2024 10:58:18 +0000 (18:58 +0800)
1  2 
qcsrc/common/mutators/mutator/nades/nades.qh
qcsrc/common/weapons/all.qh
qcsrc/menu/xonotic/_mod.inc
qcsrc/menu/xonotic/_mod.qh
qcsrc/menu/xonotic/guide/_mod.inc
qcsrc/menu/xonotic/guide/_mod.qh

index f614f093f2e5f3e1fa2a80751f25607edb3e32f5,8ac7a20c8ec9b6e421ade25240fae2fc0e9aa2a1..3a4cede4b635db73ee333f9dd9860af8debce2d4
@@@ -120,18 -123,9 +123,12 @@@ STATIC_INIT_LATE(W_PROP_reloader
  }
  #endif
  
- #define REGISTER_WEAPON(...) EVAL_REGISTER_WEAPON(OVERLOAD(REGISTER_WEAPON, __VA_ARGS__))
- #define EVAL_REGISTER_WEAPON(...) __VA_ARGS__
- #define REGISTER_WEAPON_2(id, inst) REGISTER(Weapons, WEP, id, m_id, inst)
- /** TODO: deprecated - remove */
- #define REGISTER_WEAPON_3(id, sname, inst) \
-     REGISTER_WEAPON_2(id, inst); \
-     [[alias("WEP_" #id)]] Weapon _wep_##sname
+ #define REGISTER_WEAPON(id, inst) REGISTER(Weapons, WEP, id, m_id, inst)
  
 -REGISTER_WEAPON(Null, NEW(Weapon));
 +CLASS(NullWeapon, Weapon)
 +    ATTRIB(NullWeapon, m_hidden, bool, true);
 +ENDCLASS(NullWeapon)
 +REGISTER_WEAPON(Null, NEW(NullWeapon));
  REGISTRY_DEFINE_GET(Weapons, WEP_Null)
  
  Weapon Weapon_from_name(string s)
@@@ -321,29 -320,26 +323,29 @@@ REGISTRY_CHECK(Weapons
  STATIC_INIT(register_weapons_done)
  {
        string inaccessible = "";
-     FOREACH(Weapons, true, {
-         WepSet set = it.m_wepset = _WepSet_FromWeapon(it.m_id = i);
-         WEPSET_ALL |= set;
-         if (it.spawnflags & WEP_FLAG_SUPERWEAPON) WEPSET_SUPERWEAPONS |= set;
-         if (it == WEP_Null) continue;
-         int imp = WEP_IMPULSE_BEGIN + it.m_id - 1;
-         if (imp <= WEP_IMPULSE_END)
-             localcmd(sprintf("alias weapon_%s \"impulse %d\"\n", it.netname, imp));
-         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);
-     #ifdef CSQC
-     FOREACH(Weapons, true, it.wr_init(it));
-     #endif
-     #ifdef MENUQC
-     FOREACH(Weapons, (it.spawnflags & WEP_FLAG_HIDDEN) && (it.spawnflags & WEP_FLAG_SPECIALATTACK), it.m_hidden = true); // TODO: should "hidden" weapons like the tuba actually be hidden?
-     #endif
-     weaponorder_byid = "";
-     for (int i = REGISTRY_MAX(Weapons) - 1; i >= 1; --i)
-         if (REGISTRY_GET(Weapons, i))
-             weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i));
-     weaponorder_byid = strzone(substring(weaponorder_byid, 1, -1));
+       FOREACH(Weapons, true, {
+               WepSet set = it.m_wepset = _WepSet_FromWeapon(it.m_id = i);
+               WEPSET_ALL |= set;
+               if (it.spawnflags & WEP_FLAG_SUPERWEAPON) WEPSET_SUPERWEAPONS |= set;
+               if (it == WEP_Null) continue;
+               int imp = WEP_IMPULSE_BEGIN + it.m_id - 1;
+               if (imp <= WEP_IMPULSE_END)
+                       localcmd(sprintf("alias weapon_%s \"impulse %d\"\n", it.netname, imp));
+               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);
+       #ifdef CSQC
+       FOREACH(Weapons, true, it.wr_init(it));
+       #endif
++      #ifdef MENUQC
++      FOREACH(Weapons, (it.spawnflags & WEP_FLAG_HIDDEN) && (it.spawnflags & WEP_FLAG_SPECIALATTACK), it.m_hidden = true); // TODO: should "hidden" weapons like the tuba actually be hidden?
++      #endif
+       weaponorder_byid = "";
+       for (int i = REGISTRY_MAX(Weapons) - 1; i >= 1; --i)
+               if (REGISTRY_GET(Weapons, i))
+                       weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i));
+       weaponorder_byid = strzone(substring(weaponorder_byid, 1, -1));
  }
  
  #ifdef GAMEQC
Simple merge
Simple merge
index a38cbdaffe45d9f22dab6a6bbf2b84e16b1bfd05,0000000000000000000000000000000000000000..de777f7c083438db877a8f0835613346b28f7b35
mode 100644,000000..100644
--- /dev/null
@@@ -1,5 -1,0 +1,5 @@@
- // generated file; do not modify
++// genmod.sh autogenerated file; do not modify
 +#include <menu/xonotic/guide/description.qc>
 +#include <menu/xonotic/guide/entries.qc>
 +#include <menu/xonotic/guide/tab.qc>
 +#include <menu/xonotic/guide/topics.qc>
index c90a3f2ec314e53fe1701f93c347b76636693f59,0000000000000000000000000000000000000000..80d076c5a2ce1a453ab289bc8b689ac8653600e0
mode 100644,000000..100644
--- /dev/null
@@@ -1,5 -1,0 +1,5 @@@
- // generated file; do not modify
++// genmod.sh autogenerated file; do not modify
 +#include <menu/xonotic/guide/description.qh>
 +#include <menu/xonotic/guide/entries.qh>
 +#include <menu/xonotic/guide/tab.qh>
 +#include <menu/xonotic/guide/topics.qh>