Oddity in scan AI methods
Posted: Fri Apr 22, 2011 1:02 pm
Digging through AI code, I noticed that the shared implementation for a number of AI
(This won’t be changing for 1.76, but I’m cleaning up the code for 2.0.)
scanForFoo
methods explicitly excludes ships with scan class CLASS_CARGO
. The affected methods are:
-
scanForNearestIncomingMissile
-
scanForNearestShipWithPrimaryRole:
-
scanForNearestShipHavingRole:
-
scanForNearestShipWithAnyPrimaryRole:
-
scanForNearestShipHavingAnyRole:
-
scanForNearestShipWithScanClass:
-
scanForNearestShipWithoutPrimaryRole:
-
scanForNearestShipNotHavingRole:
-
scanForNearestShipWithoutAnyPrimaryRole:
-
scanForNearestShipNotHavingAnyRole:
-
scanForNearestShipWithoutScanClass:
scanForNearestIncomingMissile
, this obviously has no effect. For scanForNearestShipWithScanClass:
, it’s clearly the wrong thing. But is there a good reason for it in the other cases?(This won’t be changing for 1.76, but I’m cleaning up the code for 2.0.)