Skip to content

Commit

Permalink
Fixed issue with The First Dwarves victory condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Nov 20, 2017
1 parent c7146ea commit 6adacd0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/civilizations/dwarf/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ DefineQuest("andvaris-gold", {
PlayerColor = "yellow",
Conditions = function(s)
if (
GetFactionExists("oinling-clan") -- Andvari's clan must exist
GetFactionExists("oinling-clan", true) -- Andvari's clan must exist
and GetNumUnitsAt(trigger_player, "any", {490 - 256 - NidavellirStartX, 107 - 256 - NidavellirStartY}, {490 + 256 - NidavellirStartX, 107 + 256 - NidavellirStartY}, GetMapLayer("material-plane", "nidavellir", 0)) > 0 -- the player must be within a certain distance of Andvari's holding
) then
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
AddTrigger("on-the-vanaquisl-introduction",
function()
for i=0,(PlayerMax - 2) do
if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "Faction") == "asa-tribe" and GetFactionExists("vana-tribe")) then
if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "Faction") == "asa-tribe" and GetFactionExists("vana-tribe", true)) then
trigger_player = i
return true
end
Expand Down Expand Up @@ -82,7 +82,7 @@ AddTrigger("on-the-vanaquisl-vana-sighted",
AddTrigger("westward-migration-introduction",
function()
for i=0,(PlayerMax - 2) do
if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "Faction") == "asa-tribe" and GetFactionExists("uralic-tribe")) then
if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "Faction") == "asa-tribe" and GetFactionExists("uralic-tribe", true)) then
trigger_player = i
return true
end
Expand Down Expand Up @@ -190,8 +190,8 @@ AddTrigger("the-settlement-of-scandinavia-introduction",
if (
GetPlayerData(i, "TotalNumUnitsConstructed") > 0
and GetPlayerData(i, "Faction") == "asa-tribe"
and GetFactionExists("ertebolle-tribe")
and GetFactionExists("gylfing-tribe")
and GetFactionExists("ertebolle-tribe", true)
and GetFactionExists("gylfing-tribe", true)
and GetNumUnitsAt(i, "any", {4068 - EarthStartX - 16, 811 - EarthStartY - 16}, {4068 - EarthStartX + 16, 811 - EarthStartY + 16}, GetMapLayer("material-plane", "earth", 0)) > 0 -- must have units near Kiel
) then
trigger_player = i
Expand Down Expand Up @@ -233,7 +233,7 @@ AddTrigger("northwards-to-the-sea-natives-sighted",
AddTrigger("northwards-to-the-sea-victory",
function()
for i=0,(PlayerMax - 2) do
if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "HasQuest", "the-settlement-of-scandinavia") and GetFactionExists("ertebolle-tribe") == false and GetFactionExists("gylfing-tribe")) then
if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "HasQuest", "the-settlement-of-scandinavia") and GetFactionExists("ertebolle-tribe", true) == false and GetFactionExists("gylfing-tribe", true)) then
trigger_player = i
return true
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/stratagus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,9 @@ function GetCivilizationExists(civilization)
return false
end

function GetFactionExists(faction)
function GetFactionExists(faction, only_living)
for i=0,(PlayerMax - 2) do
if (Players[i].Type ~= PlayerNobody and (GetPlayerData(i, "Name") == faction or GetPlayerData(i, "Faction") == faction) and GetPlayerData(i, "TotalNumUnitsConstructed") > 0) then
if (Players[i].Type ~= PlayerNobody and (GetPlayerData(i, "Name") == faction or GetPlayerData(i, "Faction") == faction) and (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 or not only_living)) then
return true
end
end
Expand Down

0 comments on commit 6adacd0

Please sign in to comment.