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

@@ -32,8 +32,8 @@ WorldLoaded = function()
InitObjectives(GDI)
secureAreaObjective = GDI.AddObjective("Eliminate all Nod forces in the area.")
beachheadObjective = GDI.AddObjective("Establish a beachhead.", "Secondary", false)
SecureAreaObjective = GDI.AddObjective("Eliminate all Nod forces in the area.")
BeachheadObjective = GDI.AddObjective("Establish a beachhead.", "Secondary", false)
ReinforceWithLandingCraft(GDI, MCVReinforcements, lstStart.Location + CVec.New(2, 0), lstEnd.Location + CVec.New(2, 0), mcvTarget.Location)
Reinforce(InfantryReinforcements)
@@ -46,15 +46,15 @@ end
Tick = function()
if Nod.HasNoRequiredUnits() then
GDI.MarkCompletedObjective(secureAreaObjective)
GDI.MarkCompletedObjective(SecureAreaObjective)
end
if DateTime.GameTime > DateTime.Seconds(5) and GDI.HasNoRequiredUnits() then
GDI.MarkFailedObjective(beachheadObjective)
GDI.MarkFailedObjective(secureAreaObjective)
GDI.MarkFailedObjective(BeachheadObjective)
GDI.MarkFailedObjective(SecureAreaObjective)
end
if DateTime.GameTime % DateTime.Seconds(1) == 0 and not GDI.IsObjectiveCompleted(beachheadObjective) and CheckForBase(GDI, GDIBaseBuildings) then
GDI.MarkCompletedObjective(beachheadObjective)
if DateTime.GameTime % DateTime.Seconds(1) == 0 and not GDI.IsObjectiveCompleted(BeachheadObjective) and CheckForBase(GDI, GDIBaseBuildings) then
GDI.MarkCompletedObjective(BeachheadObjective)
end
end