Fix a crash in the soviet04 missions

This commit is contained in:
abcdefg30
2015-09-27 19:04:38 +02:00
parent 7fa7ebe657
commit 3a68364bc5
2 changed files with 22 additions and 8 deletions

View File

@@ -37,14 +37,21 @@ RunInitialActivities = function()
Trigger.OnEnteredFootprint(VillageCamArea, function(actor, id)
if actor.Owner == player then
local camera = Actor.Create("camera", true, { Owner = player, Location = VillagePoint.Location })
Trigger.RemoveFootprintTrigger(id)
Trigger.OnAllKilled(Village, function()
camera.Destroy()
end)
if not AllVillagersDead then
VillageCamera = Actor.Create("camera", true, { Owner = player, Location = VillagePoint.Location })
end
end
end)
Trigger.OnAllKilled(Village, function()
if VillageCamera then
VillageCamera.Destroy()
end
AllVillagersDead = true
end)
Trigger.OnAnyKilled(Civs, function()
Trigger.ClearAll(civ1)
Trigger.ClearAll(civ2)

View File

@@ -39,14 +39,21 @@ RunInitialActivities = function()
Trigger.OnEnteredFootprint(VillageCamArea, function(actor, id)
if actor.Owner == player then
local camera = Actor.Create("camera", true, { Owner = player, Location = VillagePoint.Location })
Trigger.RemoveFootprintTrigger(id)
Trigger.OnAllKilled(Village, function()
camera.Destroy()
end)
if not AllVillagersDead then
VillageCamera = Actor.Create("camera", true, { Owner = player, Location = VillagePoint.Location })
end
end
end)
Trigger.OnAllKilled(Village, function()
if VillageCamera then
VillageCamera.Destroy()
end
AllVillagersDead = true
end)
Trigger.OnAnyKilled(Civs, function()
Trigger.ClearAll(civ1)
Trigger.ClearAll(civ2)