AI files that use globals instead of locals #4717
Labels
area: AI
related to AI functions
area: sim
Area that is affected by the Simulation of the Game
status: new issue
Is added to every issue to indicate that it has not been reviewed yet
type: bug
Milestone
Describe the bug
While investigating a dead loop and looking for oddities I found a bunch of varaibles related to AI that are set as global instead of local. This could be causing issues with AI where they are sharing/modifying each others variables during games which would cause strange behavior.
I'll go through and look to fix the AI specific ones that I understand and consult others for ones that are not directly AI. The biggest culprits are the Sorian functions.
List of noted fuctions and associated vars
aibehavours.lua
function GetNavalPlatoonMaxRange
function CDRRunAway
function CDROverCharge
TempestBehavior = function(self)
function CDROverChargeSorian
function CommanderThreadSorian
AhwassaBehaviorSorian
aibuildstructures.lua
function DoHackyLogic
aiutilities.lua
function AIGetSortedScoutingLocations
function GetNearestPathingPoint
function AIFindPingTargetInRangeSorian
function AIFindAirAttackTargetInRangeSorian
function AIFindBrainTargetInRangeSorian
function AIFindUndefendedBrainTargetInRangeSorian
sorianutilities.lua
function AIHandleLandIntel
function AIRandomizeTaunt
function AIHandlePing
function FindUnfinishedUnits
function FindDamagedShield
shieldPercent is not local
function Round(x, places)
function CreateExplosionMesh
navgenerator.lua
maputil.lua
function GetStartPositions
unicountbuildconditions.lua
function UnfinishedUnits
The text was updated successfully, but these errors were encountered: