distanceInCellCoords will return the distance between pSoldier and closest known opponent. We're often calculating same range after the call using PythSpacesAway and this way it's no longer necessary in most cases.
* Removes the need to constantly check for fCivilian, ARMED_VEHICLE, ENEMY_ROBOT etc inside DecideAction
* Move AI decision checks into their own functions, such as DecideActionRadioRedAlert
* Add new entry to ActionType. AI_ACTION_INVALID signals that no valid action was found when a function returns, or no valid action is possible
* Do a weighted random selection for choosing target under DecideActionBlackSoldier
Code used wrong item to calculate recoil and burst APs causing the burst length loop to be stuck until the whole 2000 round mg magazine would be fired in one go.
Bloodcat lair had a few cats with CLOSE PATROL orders, resulting them to move only 15 tiles from their starting point, allowing them to be picked off from afar with scoped rifles.
Functionality for rendering pathfinding and cover values in tactical was behind defunct #ifdefs.
It's now compiled always, but only enabled if cheat level is BEDUG_CHEAT_LEVEL.
Unified rendering the debug info into one function, instead of several nearly identical ones.
Ctrl + Shift + Z cycles through the different debug modes.
Now it should be fairly easy to add more info modes like these two in the future.
when in water. If our current or last action was AI_ACTION_SEEK_OPPONENT.
The AI tends to flipflop between jumping into water, swimming a certain distance and then "panic" because they're in the water and then try to reach the closest land tile. Which is often right where they entered the water. Adding a bit of decision momentum with this change should help with that.
Calling InternalGoAsFarAsPossibleTowards() with target's gridno means AI doesn't take into account eg. nearby friendlies resulting in them bunching up and making a beeline straight at whoever they're trying to attack.
We'll first at least attempt to find a cover spot near said target, if it doesn't work, only then head straight at them.