Changes between Initial Version and Version 3 of Ticket #3412


Ignore:
Timestamp:
Jan 6, 2016, 7:31:15 PM (8 years ago)
Author:
elexis
Comment:

Hi, thanks for your participation and looking at that big UnitAI maze!

After looking at your patch I added some more points to the ticket description on how this should be fixed.

With regards to your patch:

  • Don't change UnitAI.canGarrison to work with and without argument. It would be more clear to add a new function IsGarrisonable instead that takes no argument. This should be implemented in the templates. Maybe UnitAI can be left untouched.
  • Minor detail: it'd be more coherent if you use var cmpIdentity = ... and then check if (cmpIdentity.hasClass("Ship"))

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3412

    • Property Keywords patch added; simple removed
    • Property Summary Hide garrisson button for ships[PATCH] Hide garrisson button for ungarrisonable units
  • Ticket #3412 – Description

    initial v3  
    1 Ships can't be garrissoned anywhere. Therefore the button is useless and should be removed for ships.
     1Some units can't be garrissoned anywhere and have incoherent garrisson usage:
     2
     3* '''Ships''' can't be garrissoned anywhere.
     4 Whether or not they should (for example in the carthaginian military dock) is a design question. In case we go with that, it should be done in another ticket.
     5
     6* '''Sheep'''
     7 Currently `UnitAI` can't deal with garrisoning animals. Hence it has a hardcoded disabling of animals. The GUI still draws the garrison cursor for sheep, which should not happen.
     8
     9* The '''worker elephant''' can be garrisoned in temples, towers, outposts and other buildings that don't make  sense (see #3611). It should be coherent with '''war-elephants''', i.e. garrisonable only in buildings that make sense (#3135) or nowhere.
     10
     11Due to these circumstances it seems appropriate to add a new boolean property `IsGarrisonable` to the '''templates''' which is true for all units except for those mentioned above.
     12If that property is false, the garrison '''cursor and button should be hidden'''.
     13
     14Besides making those three cases coherent and fixing the worker elephant bug, it will also ease future edits (prohibiting garrisoning of some units).