]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/all.qc
Registry API: add REGISTRY_GET
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / all.qc
index 45ba22906e042185002f639456f96558972ad455..736ed9c9d23be1050ff57350be5a4cbe2bca2b97 100644 (file)
@@ -107,7 +107,7 @@ string W_NameWeaponOrder_MapFunc(string s)
        int i = stof(s);
        if (s == "0" || i)
        {
-               entity wi = Weapons_from(i);
+               entity wi = REGISTRY_GET(Weapons, i);
                if (wi != WEP_Null) return wi.netname;
        }
        return s;
@@ -156,9 +156,9 @@ void W_FixWeaponOrder_BuildImpulseList_swap(int i, int j, entity pass)
 float W_FixWeaponOrder_BuildImpulseList_cmp(int i, int j, entity pass)
 {
        int si = W_FixWeaponOrder_BuildImpulseList_buf[i];
-       Weapon e1 = Weapons_from(si);
+       Weapon e1 = REGISTRY_GET(Weapons, si);
        int sj = W_FixWeaponOrder_BuildImpulseList_buf[j];
-       Weapon e2 = Weapons_from(sj);
+       Weapon e2 = REGISTRY_GET(Weapons, sj);
        int d = (e1.impulse + 9) % 10 - (e2.impulse + 9) % 10;
        if (d != 0) return -d;  // high impulse first!
        return strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "),