1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Privateers beginning their move inside a friendly city trigger "Declare war popup"

Discussion in 'Civ4 - Bug Reports' started by Pep, Aug 7, 2008.

  1. Pep

    Pep King

    Joined:
    May 28, 2002
    Messages:
    688
    Location:
    Spain
    I have seen the following bug: if you select a privateer that is docked in a city and then you attempt to move it to a tile owned by a civilization to whom you haven't signed an open borders treaty, a "Declare war popup" appears. It doesn't happen when the privateer begins its movement outside the city.

    Caravels and submarines which begin their movement inside a city doesn't trigger the "declare war" popup.

    It's a minor one bug, as you can move your privateer 1 tile from your city and then move it into enemy territory. Except if your city is completely surrounded by enemy sea tiles, of course :lol:
     
  2. Pep

    Pep King

    Joined:
    May 28, 2002
    Messages:
    688
    Location:
    Spain
    I think I have found the code that produces the bug:

    The function:
    bool CvUnit::canEnterTerritory(TeamTypes eTeam, bool bIgnoreRightOfPassage)
    returns true when the unit is a privateer and
    bool CvUnit::isAlwaysHostile(const CvPlot* pPlot)
    returns true.

    "isAlwaysHostile" returns false when the privateer is in a city and true otherwise, and that is why the "Declare war" popup appears...

    I think the bug can be resolved by making canEnterTerritory to return true when getUnitInfo().isHiddenNationality() is true (which happens with privateers units).
     

Share This Page