exclude a building from spy sabotage

keldath

LivE LonG AnD PrOsPeR
Joined
Dec 20, 2005
Messages
7,578
Location
israel
hey all,

im trying to create a building(s) that will always be present in a player city -
-survive nukes (existing xml)
-never be destroyed(conquest == 100)

and that a spy will not be able to destroy -
which i need help with -
where in the code can i define this?
python or sdk both are ok - i dont mind hard coded in both.



i have a code that adds that type of a building for each city that is built in the game.

thanks in advance.
 
Code:
bool CvPlayer::canSpyDestroyBuilding(PlayerTypes eTarget, BuildingTypes eBuilding) const
{
   CvBuildingInfo& kBuilding = GC.getBuildingInfo(eBuilding);
   if (kBuilding.getProductionCost() <= 0)
   {
       return false;
   }
  
   if (::isLimitedWonderClass((BuildingClassTypes)kBuilding.getBuildingClassType()))
   {
       return false;
   }

   return true;
}
I.e. setting the cost to 0 or less in XML should protect the building from spies.
 
Back
Top Bottom