Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --AIBrain.lua hook - remove non-allied gold amounts from sync, except for observers
- local prevClass = AIBrain
- AIBrain = Class(prevClass) {
- InternalGiveResources = function(self, type, amount)
- prevClass.InternalGiveResources(self, type, amount)
- if Sync.ArmyGold and Sync.ArmyGold[self:GetArmyIndex()] > 0
- and GetFocusArmy() ~= -1 and not IsAlly(GetFocusArmy(), self:GetArmyIndex()) then
- Sync.ArmyGold[self:GetArmyIndex()] = 0
- end
- end,
- TakeResource = function(self, type, amount)
- prevClass.TakeResource(self, type, amount)
- if Sync.ArmyGold and Sync.ArmyGold[self:GetArmyIndex()] > 0
- and GetFocusArmy() ~= -1 and not IsAlly(GetFocusArmy(), self:GetArmyIndex()) then
- Sync.ArmyGold[self:GetArmyIndex()] = 0
- end
- end,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement