mirror of
https://github.com/edgegamers/Jailbreak.git
synced 2025-12-06 04:42:57 -08:00
Revert namespace modification that requires global:: prefix for Tags
This commit is contained in:
@@ -165,7 +165,7 @@ public class LastGuard(ILGLocale notifications, ILastRequestManager lrManager)
|
||||
if (weapons == null) return false;
|
||||
foreach (var weapon in weapons.MyWeapons) {
|
||||
if (weapon.Value == null) continue;
|
||||
if (!global::Tag.GUNS.Contains(weapon.Value.DesignerName)) continue;
|
||||
if (!Tag.GUNS.Contains(weapon.Value.DesignerName)) continue;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ public class LogEntityParentListeners(IRichLogService logs) : IPluginBehavior {
|
||||
public void OnEntityParentChanged(CEntityInstance affectedEntity,
|
||||
CEntityInstance newParent) {
|
||||
if (!affectedEntity.IsValid) return;
|
||||
if (!global::Tag.WEAPONS.Contains(affectedEntity.DesignerName)
|
||||
&& !global::Tag.UTILITY.Contains(affectedEntity.DesignerName))
|
||||
if (!Tag.WEAPONS.Contains(affectedEntity.DesignerName)
|
||||
&& !Tag.UTILITY.Contains(affectedEntity.DesignerName))
|
||||
return;
|
||||
|
||||
var weaponEntity =
|
||||
|
||||
@@ -10,7 +10,7 @@ public class AmmoWeaponReward : WeaponReward {
|
||||
|
||||
public AmmoWeaponReward(string weapon, int primary, int secondary,
|
||||
CsTeam requiredTeam = CsTeam.Terrorist) : base(weapon, requiredTeam) {
|
||||
Trace.Assert(global::Tag.GUNS.Contains(weapon));
|
||||
Trace.Assert(Tag.GUNS.Contains(weapon));
|
||||
this.primary = primary;
|
||||
this.secondary = secondary;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public class CannotScope(BasePlugin plugin) : AbstractOnTickReward(plugin) {
|
||||
if (weaponServices == null) return;
|
||||
var activeWeapon = weaponServices.ActiveWeapon.Value;
|
||||
if (activeWeapon == null || !activeWeapon.IsValid) return;
|
||||
if (!global::Tag.SNIPERS.Contains(activeWeapon.DesignerName)) return;
|
||||
if (!Tag.SNIPERS.Contains(activeWeapon.DesignerName)) return;
|
||||
activeWeapon.NextSecondaryAttackTick = Server.TickCount + 500;
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class HideAndSeekDay(BasePlugin plugin, IServiceProvider provider)
|
||||
public static readonly FakeConVar<string> CV_GUARD_WEAPONS = new(
|
||||
"jb_sd_hns_weapons_ct",
|
||||
"List of weapons/items CTs may use, empty for no restrictions",
|
||||
string.Join(",", global::Tag.PISTOLS.Union(global::Tag.UTILITY)),
|
||||
string.Join(",", Tag.PISTOLS.Union(Tag.UTILITY)),
|
||||
ConVarFlags.FCVAR_NONE, new ItemValidator(allowMultiple: true));
|
||||
|
||||
public static readonly FakeConVar<string> CV_PRISONER_WEAPONS = new(
|
||||
|
||||
@@ -142,7 +142,7 @@ public class InfectionDay(BasePlugin plugin, IServiceProvider provider)
|
||||
|
||||
public override ISet<string>? AllowedWeapons(CCSPlayerController player) {
|
||||
return player.Team == CsTeam.CounterTerrorist ?
|
||||
global::Tag.UTILITY.Union(global::Tag.PISTOLS).ToHashSet() :
|
||||
Tag.UTILITY.Union(Tag.PISTOLS).ToHashSet() :
|
||||
null;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class NoScopeDay(BasePlugin plugin, IServiceProvider provider)
|
||||
"jb_sd_noscope_allowedweapons",
|
||||
"Weapons to allow players to use, empty for no restrictions",
|
||||
string.Join(",",
|
||||
global::Tag.UTILITY.Union(new[] { "weapon_ssg08", "weapon_knife" }
|
||||
Tag.UTILITY.Union(new[] { "weapon_ssg08", "weapon_knife" }
|
||||
.ToHashSet())), ConVarFlags.FCVAR_NONE,
|
||||
new ItemValidator(allowMultiple: true));
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
namespace Jailbreak.Tag;
|
||||
|
||||
[Flags]
|
||||
[Flags]
|
||||
public enum WeaponType {
|
||||
GRENADE = 1 << 0, // 1
|
||||
UTILITY = 1 << 1, // 2
|
||||
@@ -20,25 +18,25 @@ public static class WeaponTypeExtensions {
|
||||
|
||||
switch (type) {
|
||||
case WeaponType.GUNS:
|
||||
return global::Tag.GUNS;
|
||||
return Tag.GUNS;
|
||||
case WeaponType.HEAVY:
|
||||
return global::Tag.HEAVY;
|
||||
return Tag.HEAVY;
|
||||
case WeaponType.SMGS:
|
||||
return global::Tag.SMGS;
|
||||
return Tag.SMGS;
|
||||
case WeaponType.SHOTGUNS:
|
||||
return global::Tag.SHOTGUNS;
|
||||
return Tag.SHOTGUNS;
|
||||
case WeaponType.PISTOLS:
|
||||
return global::Tag.PISTOLS;
|
||||
return Tag.PISTOLS;
|
||||
case WeaponType.RIFLES:
|
||||
return global::Tag.RIFLES;
|
||||
return Tag.RIFLES;
|
||||
case WeaponType.SNIPERS:
|
||||
return global::Tag.SNIPERS;
|
||||
return Tag.SNIPERS;
|
||||
case WeaponType.UTILITY:
|
||||
return global::Tag.UTILITY;
|
||||
return Tag.UTILITY;
|
||||
case WeaponType.GRENADE:
|
||||
return global::Tag.GRENADES;
|
||||
return Tag.GRENADES;
|
||||
case WeaponType.WEAPON:
|
||||
return global::Tag.WEAPONS;
|
||||
return Tag.WEAPONS;
|
||||
default:
|
||||
foreach (var t in Enum.GetValues<WeaponType>())
|
||||
if (type.HasFlag(t))
|
||||
|
||||
Reference in New Issue
Block a user