Menu

#3237 can't inicite Inidans

Fixed_0.12.0
closed-fixed
nobody
5
2022-05-01
2022-01-16
Bernat
No

Hello

I can't incite Indians to war
I attach freecol log and a saved game
I can't start a new game to try, It's and old game of 11.6 loaded with the latest sources (sources from 2022-01-15)

To reproduce the error, please, follow this, steps.
Go to Ganyadaiyo,
There are two missionaries,
Incite Ganyadaio, select country against, and nothing happens

Thanks for your great work!
Sincerely

2 Attachments

Discussion

  • Bernat

    Bernat - 2022-01-23

    Hello

    I think the problem is in introduced

    in 2020-01-20 Commit: [ee62792]
    Is changed

    InicteMessage.java

    --    public Unit getUnit(Player player) {
     --       return player.getOurFreeColGameObject(getStringAttribute(UNIT_TAG), Unit.class);
     ++   public ServerUnit getUnit(Player player) {
     ++      return player.getOurFreeColGameObject(getStringAttribute(UNIT_TAG), ServerUnit.class);
    

    Now when we try to move my missionary to Native settlement and try to incite, and select Nation, it returns Unit instead ServerUnit and it throws and exception who kills the next panel (price for "Incite Indians") because expect a ServerUnit
    I try this patch and apparently works, but I really don't have idea what I'm doing and if I worsening things

    InicteMessage.java

    97    public void clientHandler(FreeColClient freeColClient) {
            final Game game = freeColClient.getGame();
            final Player player = freeColClient.getMyPlayer();
    --        final Unit unit = getUnit(player);
    ++        final Unit unit = (player.isAI())?getUnit(player):getCommonUnit(player);
            final IndianSettlement is = getSettlement(unit);
            final Player enemy = getEnemy(game);
            final int gold = getGold();
    
            igc(freeColClient).inciteHandler(unit, is, enemy, gold);
     106       clientGeneric(freeColClient);
    

    InicteMessage.java (too)

    ++    public Unit getCommonUnit(Player player) {
    ++        return player.getOurFreeColGameObject(getStringAttribute(UNIT_TAG), Unit.class);
    ++    }
    

    I really don't understand what is a ServerUnit and his difference with Unit, if anyone can explain I can try a better patch

    Thanks for your time
    greetings

     
  • Mike Pope

    Mike Pope - 2022-02-19

    Thanks for the clear report, apologies for the delay getting to it. Should be fixed in git.5ec7b1f. Setting to Pending.

     
  • Mike Pope

    Mike Pope - 2022-02-19
    • status: open --> pending-fixed
    • Group: Current --> Fixed_trunk
     
  • Bernat

    Bernat - 2022-02-20

    Very thanks Mike
    It's working Again
    :D

     
  • Mike Pope

    Mike Pope - 2022-05-01
    • Group: Fixed_trunk --> Fixed_0.12.0
     
  • Mike Pope

    Mike Pope - 2022-05-01
    • Status: pending-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB