Code cleanup in the Tiberian Dawn Lua scripts.

Uppercase global variables.
Declare local variables.
Remove unused variable.
This commit is contained in:
Matthias Mailänder
2022-09-09 10:13:24 +02:00
committed by Gustas
parent ca45e02265
commit b8e261ff2f
18 changed files with 108 additions and 115 deletions

View File

@@ -16,7 +16,6 @@ GDIReinforcementsPart2 = { "e2", "e2", "e2", "e2", "e2" }
TownAttackWave1 = { "bggy", "bggy" }
TownAttackWave2 = { "ltnk", "ltnk" }
TownAttackWave3 = { "e1", "e1", "e1", "e3", "e3", "e3" }
TownAttackWpts = { waypoint1, waypoint2 }
Civvie1Wpts = { CivvieWpts1, CivvieWpts2 }
Civvie2Wpts = { CivvieWpts3, CivvieWpts1, CivvieWpts4, CivvieWpts5, CivvieWpts6, CivvieWpts7, CivvieWpts8, CivvieWpts9, CivvieWpts10, CivvieWpts11 }
@@ -41,7 +40,6 @@ end
TownAttackAction = function(actor)
Trigger.OnIdle(actor, TownAttackersIdleAction)
FollowWaypoints(actor, TownAttackWpts)
end
AttackTown = function()
@@ -80,16 +78,16 @@ WorldLoaded = function()
EliminateNod = GDI.AddPrimaryObjective("Eliminate all Nod forces in the area.")
Trigger.OnExitedFootprint(TownAttackTrigger, function(a, id)
if not townAttackTrigger and a.Owner == GDI then
townAttackTrigger = true
if not TownAttackTriggered and a.Owner == GDI then
TownAttackTriggered = true
Trigger.RemoveFootprintTrigger(id)
AttackTown()
end
end)
Trigger.OnEnteredFootprint(GDIReinforcementsTrigger, function(a, id)
if not gdiReinforcementsTrigger and a.Owner == GDI then
gdiReinforcementsTrigger = true
if not GDIReinforcementsTriggered and a.Owner == GDI then
GDIReinforcementsTriggered = true
Trigger.RemoveFootprintTrigger(id)
SendGDIReinforcements()
end