diff --git a/project/SPT.SinglePlayer/Patches/RaidFix/FirearmControllerShowIncompatibleNotificationClass.cs b/project/SPT.SinglePlayer/Patches/RaidFix/FirearmControllerShowIncompatibleNotificationClass.cs new file mode 100644 index 0000000..8290bb1 --- /dev/null +++ b/project/SPT.SinglePlayer/Patches/RaidFix/FirearmControllerShowIncompatibleNotificationClass.cs @@ -0,0 +1,23 @@ +using EFT; +using SPT.Reflection.Patching; +using System.Reflection; + +namespace SPT.SinglePlayer.Patches.RaidFix +{ + /// + /// This patch stops the player from receiving the incompatible ammo notification if it's triggered by an AI + /// + public class FirearmControllerShowIncompatibleNotificationClass : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return typeof(Player.FirearmController.GClass1748).GetMethod(nameof(Player.FirearmController.GClass1748.ShowIncompatibleNotification)); + } + + [PatchPrefix] + public static bool Prefix(Player ___player_0) + { + return ___player_0.IsYourPlayer; + } + } +} diff --git a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs index 3196f61..7b862d2 100644 --- a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs +++ b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs @@ -62,6 +62,7 @@ namespace SPT.SinglePlayer new FixLocalRaidPatch().Enable(); new ScavIsPlayerEnemyPatch().Enable(); new BotOwnerManualUpdatePatch().Enable(); + new FirearmControllerShowIncompatibleNotificationClass().Enable(); } catch (Exception ex) {