diff --git a/units/UAB3101/UAB3101_script.lua b/units/UAB3101/UAB3101_script.lua index 95d4afc4e6..93fb2fe375 100644 --- a/units/UAB3101/UAB3101_script.lua +++ b/units/UAB3101/UAB3101_script.lua @@ -25,17 +25,16 @@ UAB3101 = ClassUnit(ARadarUnit) { end, OnIntelEnabled = function(self, intel) - local rotator = self.Rotator1 local trash = self.Trash ARadarUnit.OnIntelEnabled(self, intel) - if not rotator then - rotator= CreateRotator(self, 'B01', 'y') - TrashBagAdd(trash,rotator) + if not self.Rotator1 then + self.Rotator1 = CreateRotator(self, 'B01', 'y') + TrashBagAdd(trash, self.Rotator1) end - rotator:SetSpinDown(false) - rotator:SetTargetSpeed(30) - rotator:SetAccel(20) + self.Rotator1:SetSpinDown(false) + self.Rotator1:SetTargetSpeed(30) + self.Rotator1:SetAccel(20) end, } diff --git a/units/UAB3104/UAB3104_script.lua b/units/UAB3104/UAB3104_script.lua index 88a554661e..ea3ddeab9d 100644 --- a/units/UAB3104/UAB3104_script.lua +++ b/units/UAB3104/UAB3104_script.lua @@ -27,34 +27,31 @@ UAB3104 = ClassUnit(ARadarUnit) { OnIntelEnabled = function(self, intel) ARadarUnit.OnIntelEnabled(self, intel) - local rotator1 = self.Rotator1 - local rotator2 = self.Rotator2 - local rotator3 = self.Rotator3 local trash = self.Trash - if not rotator1 then - rotator1 = CreateRotator(self, 'B03', 'y') - TrashBagAdd(trash,rotator1) + if not self.Rotator1 then + self.Rotator1 = CreateRotator(self, 'B03', 'y') + TrashBagAdd(trash,self.Rotator1) end - rotator1:SetSpinDown(false) - rotator1:SetTargetSpeed(30) - rotator1:SetAccel(20) + self.Rotator1:SetSpinDown(false) + self.Rotator1:SetTargetSpeed(30) + self.Rotator1:SetAccel(20) - if not rotator2 then - rotator2 = CreateRotator(self, 'B02', 'y') - TrashBagAdd(trash,rotator2) + if not self.Rotator2 then + self.Rotator2 = CreateRotator(self, 'B02', 'y') + TrashBagAdd(trash,self.Rotator2) end - rotator2:SetSpinDown(false) - rotator2:SetTargetSpeed(60) - rotator2:SetAccel(20) + self.Rotator2:SetSpinDown(false) + self.Rotator2:SetTargetSpeed(60) + self.Rotator2:SetAccel(20) - if not rotator3 then - rotator3 = CreateRotator(self, 'B01', 'y') - TrashBagAdd(trash,rotator3) + if not self.Rotator3 then + self.Rotator3 = CreateRotator(self, 'B01', 'y') + TrashBagAdd(trash,self.Rotator3) end - rotator3:SetSpinDown(false) - rotator3:SetTargetSpeed(120) - rotator3:SetAccel(20) + self.Rotator3:SetSpinDown(false) + self.Rotator3:SetTargetSpeed(120) + self.Rotator3:SetAccel(20) end, } diff --git a/units/UAB3201/UAB3201_script.lua b/units/UAB3201/UAB3201_script.lua index 86ce0be47d..412fd085c7 100644 --- a/units/UAB3201/UAB3201_script.lua +++ b/units/UAB3201/UAB3201_script.lua @@ -19,37 +19,32 @@ UAB3201 = ClassUnit(ARadarUnit) { OnIntelDisabled = function(self, intel) ARadarUnit.OnIntelDisabled(self, intel) - local rotator1 = self.Rotator1 - local rotator2 = self.Rotator2 - - rotator1:SetSpinDown(true) - rotator1:SetAccel(60) - rotator2:SetSpinDown(true) - rotator2:SetAccel(60) + self.Rotator1:SetSpinDown(true) + self.Rotator1:SetAccel(60) + self.Rotator2:SetSpinDown(true) + self.Rotator2:SetAccel(60) end, OnIntelEnabled = function(self, intel) ARadarUnit.OnIntelEnabled(self, intel) - local rotator1 = self.Rotator1 - local rotator2 = self.Rotator2 local trash = self.Trash - if not rotator1 then - rotator1 = CreateRotator(self, 'B02', 'y') - TrashBagAdd(trash,rotator1) + if not self.Rotator1 then + self.Rotator1 = CreateRotator(self, 'B02', 'y') + TrashBagAdd(trash,self.Rotator1) end - rotator1:SetSpinDown(false) - rotator1:SetTargetSpeed(30) - rotator1:SetAccel(20) + self.Rotator1:SetSpinDown(false) + self.Rotator1:SetTargetSpeed(30) + self.Rotator1:SetAccel(20) - if not rotator2 then - rotator2 = CreateRotator(self, 'B01', 'y') - TrashBagAdd(trash,rotator2) + if not self.Rotator2 then + self.Rotator2 = CreateRotator(self, 'B01', 'y') + TrashBagAdd(trash,self.Rotator2) end - rotator2:SetSpinDown(false) - rotator2:SetTargetSpeed(60) - rotator2:SetAccel(20) + self.Rotator2:SetSpinDown(false) + self.Rotator2:SetTargetSpeed(60) + self.Rotator2:SetAccel(20) end, }