[Civup v2.3.1/Gem v1.12.1] Swords into plowshares

skodkim

Deity
Joined
Jan 16, 2004
Messages
2,497
Location
Denmark
Hi


Just noticed that with Civup v2.3.1/Gem v1.12.1 the Swords into plowshares belief give extra food modifier to cities even when you're at war, which is unintended.

See screenshots (the extra 10% is from the Temple of ArtemisWonder).

\Skodkim
 
The function seems to be located here 2_ModTools_Trunk\YieldLibrary\YieldLibrary.lua

It goes:

Spoiler :
Code:
function City_GetSurplusYieldModFromReligion(city, yieldID, itemTable, itemID, queueNum)
	local player = Players[city:GetOwner()]
	local surplusMod = 0
	if yieldID == YieldTypes.YIELD_FOOD then
		for beliefInfo in GameInfo.Beliefs("CityGrowthModifier != 0") do
			if player:HasBelief(beliefInfo.ID) then
				surplusMod = surplusMod + beliefInfo.CityGrowthModifier
			end
		end
	end
	return surplusMod
end

There doesn't seem to be a check for peacr/war but I don't really have the skill to add it.

\Skodkim
 
Sorry for bumping this but since other bugs bugs that were reported much later has been fixed already I was wondering if this had been missed.

Even without the "must be at peace clause" I feel it's a bit over powered with 25% growth (it's not that many turns you're actually at war per game) but without it it's a total exploit.

/skodkim
 
Oops! Sorry I overlooked this. I fixed it now for Civup v2.5.1 :)

if player:HasBelief(beliefInfo.ID) and not (beliefInfo.RequiresPeace and player:IsAtWarWithAny()) then
 
Did you test that this worked?

When changing the line in CivUP 2.5 I get no growth modifier neither when at peace or war.

Look at the attached screenshot of my capital (quick test game -> gave myself faith -> founded religion -> picked belief).

\Skodkim
 
Did you see any lua.log syntax error messages? The two possible mistakes are a syntax error or logic error, and I don't see a logic error. hmm... :think:

Edit:

Everyone's at war with...


...the Barbarians! :hammer2:


This also explains why AIs purchase too many military units! I'm rewriting IsAtWarWithAny to exclude the Barbarians now. :crazyeye:
 
Fantastic. I'm going to start a new game. :)

I'll report back if I see any problems.

\Skodkim
 
Back
Top Bottom