octo
Chieftain
So I've run into a bit of an issue for this mod that I'm updating and was hoping somebody might have a workaround. The code currently provides a bonus to Faith when one of my cities adopts a Religion I've founded, but it doesn't seem to work when opposing cities are converted, and I'm trying to figure out how to make that happen.
Is there something that I'm missing about this? I can't seem to figure out how to make the effect happen when converting foreign cities.
Spoiler :
Code:
function FaithFromConversions(ownerID, religionID, iX, iY)
local player = Players[ownerID]
if (player:IsAlive() and player:GetCivilizationType() == GameInfoTypes["CIVILIZATION_DESERET"]) then
local religionID = player:GetReligionCreatedByPlayer();
local city = Map.GetPlot(iX, iY):GetPlotCity()
if (city:GetReligiousMajority() == religionID) then
local numDeseretLand = player:GetNumPlots();
player:SetFaith(player:GetFaith() + numDeseretLand)
end
end
end
GameEvents.CityConvertsReligion.Add(FaithFromConversions)
-- End of Main Code --
print("DeseretUA loaded correctly")
Is there something that I'm missing about this? I can't seem to figure out how to make the effect happen when converting foreign cities.