From bb2426f4ebc2c69204b857a4e37ee1363d97d980 Mon Sep 17 00:00:00 2001 From: Hello Kitty Date: Sun, 19 Jun 2011 00:32:42 +0200 Subject: [PATCH] Added Checks to not target or engage players --- Questor.Modules/Drones.cs | 5 +++++ Questor.Modules/EntityCache.cs | 16 +++++++++++++++- Questor.Modules/GroupID.cs | 16 +++++++++++++++- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/Questor.Modules/Drones.cs b/Questor.Modules/Drones.cs index 6f8d0674c..164350d2d 100644 --- a/Questor.Modules/Drones.cs +++ b/Questor.Modules/Drones.cs @@ -119,6 +119,11 @@ private void EngageTarget() if (target == null) return; + if (target.IsPlayerShip) + { + Logging.Log("Drones: Attempting to engage player: " + target.Name); + return; + } // Is our current target still the same and is the last Engage command no longer then 15s ago? if (_lastTarget == target.Id && DateTime.Now.Subtract(_lastEngageCommand).TotalSeconds < 15) return; diff --git a/Questor.Modules/EntityCache.cs b/Questor.Modules/EntityCache.cs index 0d8374690..1356d9a69 100644 --- a/Questor.Modules/EntityCache.cs +++ b/Questor.Modules/EntityCache.cs @@ -389,9 +389,23 @@ public bool IsContainer return false; } } - + public bool IsPlayerShip + { + get + { + if (GroupId == (int)Group.Concord1 || GroupId == (int)Group.Concord2 || GroupId == (int)Group.Concord3 || GroupId == (int)Group.Indy || GroupId == (int)Group.HAC + || GroupId == (int)Group.Covops || GroupId == (int)Group.StrategicCruiser || GroupId == (int)Group.Marauder || GroupId == (int)Group.AssaultFrigate) + return true; + else return false; + } + } public void LockTarget() { + if (IsPlayerShip) + { + Logging.Log("EntityCache: Attempting to target player!" + this.Name); + return; + } if (Cache.Instance.TargetingIDs.ContainsKey(Id)) { var lastTargeted = Cache.Instance.TargetingIDs[Id]; diff --git a/Questor.Modules/GroupID.cs b/Questor.Modules/GroupID.cs index 3ded835e1..202207613 100644 --- a/Questor.Modules/GroupID.cs +++ b/Questor.Modules/GroupID.cs @@ -13,6 +13,7 @@ public enum Group { Star = 6, Station = 15, + Stargate = 10, Capsule = 29, @@ -24,8 +25,21 @@ public enum Group ArmorRepairer = 62, ArmorHardeners = 328, DamageControl = 60, - ECCM = 202, + Concord1 = 25, //frigate - concord and player + Concord2 = 26, //cruiser - concord and player + Concord3 = 27, //battleship - concord and player + Concord4 = 301, + Concord5 = 446, + ConcBillboard = 323, + + Indy = 28, + Ceptor = 831, + HAC = 358, + AssaultFrigate = 324, + Covops = 830, + StrategicCruiser = 963, + Marauder = 900, SensorBooster = 212, TrackingComputer = 213,