Forged Alliance Forever Forums
Krapougnak wrote:What can I say ... wonderful ! You did it again.
do
local oldUnit = Unit
Unit = Class(oldUnit) {
ColossusTractorWatchThread = function( self, tractorUnit )
LOG( 'Unit.lua, ColossusTractorWatchThread: ', boolean )
if boolean == nil then WARN( 'Unit.lua, ColossusTractorWatchThread, boolean missing or failed to pass' ) return end
if tractorUnit and not tractorUnit:BeenDestroyed() and self:IsUnitState( 'Attached' ) then
self.DisableUnitForGCTractor( true )
while self and not self:BeenDestroyed() and self:IsUnitState( 'Attached' ) do
WaitSeconds( 1 )
end
if self and not self:IsDead() then
self.DisableUnitForGCTractor( false )
end
end
end,
DisableUnitForGCTractor = function( self, boolean )
LOG( 'Unit.lua, DisableUnitForGCTractor: ', boolean )
if boolean == nil then WARN( 'Unit.lua, DisableUnitForGCTractor, boolean missing or failed to pass' ) return end
if boolean then
for i = 1, self:GetWeaponCount() do
local wep = self:GetWeapon( i )
wep:SetEnabled( false )
end
self:SetCanTakeDamage( false )
self:SetCanBeKilled( false )
self:SetDoNotTarget( true )
self:SetImmobile( true )
self.SetUnSelectable(self, true)
else
for i = 1, self:GetWeaponCount() do
local wep = self:GetWeapon(i)
wep:SetEnabled( true )
end
self:SetCanTakeDamage( true )
self:SetCanBeKilled( true )
self:SetDoNotTarget( false )
self:SetImmobile( false )
self.SetUnSelectable(self, false)
if self:IsUnitState( 'Attached' )
self:DetachFrom()
end
end
end,
}
end
Users browsing this forum: No registered users and 1 guest