Changes between Initial Version and Version 1 of Ticket #2154, comment 32


Ignore:
Timestamp:
Nov 28, 2013, 11:42:20 AM (10 years ago)
Author:
sanderd17

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2154, comment 32

    initial v1  
    11Line 683 of UnitAI can set the target to undefined, and this can cause some warnings. The if-else structure should be different, as the setting of the target may not be executed after this.FinishOrder is called.
     2
     3I think the following works better:
     4{{{
     5this.alertRaiser = this.order.data.raiser;
     6               
     7// Find a target to garrison into, if we don't already have one
     8if(!this.alertGarrisoningTarget)
     9    this.alertGarrisoningTarget = this.FindNearbyGarrisonHolder();
     10       
     11if (this.alertGarrisoningTarget)
     12    this.ReplaceOrder("Garrison", {"target": this.alertGarrisoningTarget});
     13}}}