courthouse ini 121

Rudenut

Chieftain
Joined
Apr 6, 2008
Messages
56
Hi, so I just captured 2 cities and occupied them after the resistance was up. I have built courthouses in each and they still show occupied and I am still gettin penalized as if they were...I can't seem to find if this was an intended change with 121. Help please.

playing as Neb, packaged perfectworld, including csd (this mod needs serious tweeking. seems the ai is much better at it than I am. I like the idea of having to use actual diplomacy instead of money but I find I can't even build all the other crap + units....er wrong forum ;p)
 
I've had sporadic reports about this for a while but difficulty tracking it down, because it hasn't happened in my games. I'm not really sure where the problem is. The code is straightforward:

Code:
<Buildings>
  <Update>
    <Where BuildingClass="BUILDINGCLASS_COURTHOUSE" />
    <Set NoOccupiedUnhappiness="false"
       NoOccupiedUnhappinessFixed="true"
       />
  </Update>
</Buildings>

PHP:
function BuildingCreated(player, city, buildingID)
  local buildingInfo = GameInfo.Buildings[buildingID]
  local endOccupy    = buildingInfo.NoOccupiedUnhappinessFixed
  if endOccupy then
    city:SetPuppet(false)
    city:SetOccupied(false)
  end
end

The mod overrides the vanilla courthouse handling because of a vanilla bug where courthouses give +4:c5happy:. I've added an override in v122 which checks cities each turn, and if it has a courthouse sets puppet and occupied to false. Hopefully that will work. However, if there is a bug in the SetPuppet or SetOccupied functions, we cannot fix it because those are in the game core only Firaxis has access to.
 
Back
Top Bottom