diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js
index 4e43217..96b0ba6 100644
a
|
b
|
UnitAI.prototype.UnitFsmSpec = {
|
844 | 844 | "Order.Attack": function(msg) { |
845 | 845 | var target = msg.data.target; |
846 | 846 | var allowCapture = msg.data.allowCapture; |
| 847 | var attackType = msg.data.attackType; |
| 848 | |
847 | 849 | var cmpTargetUnitAI = Engine.QueryInterface(target, IID_UnitAI); |
848 | 850 | if (cmpTargetUnitAI && cmpTargetUnitAI.IsFormationMember()) |
849 | 851 | target = cmpTargetUnitAI.GetFormationController(); |
850 | 852 | |
851 | 853 | var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |
852 | 854 | // Check if we are already in range, otherwise walk there |
853 | | if (!this.CheckTargetAttackRange(target, target)) |
| 855 | if (!this.CheckTargetAttackRange(target, attackType)) |
854 | 856 | { |
855 | 857 | if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) |
856 | 858 | { |
857 | | if (this.MoveToTargetAttackRange(target, target)) |
| 859 | if (this.MoveToTargetAttackRange(target, attackType)) |
858 | 860 | { |
859 | 861 | this.SetNextState("COMBAT.APPROACHING"); |
860 | 862 | return; |
… |
… |
UnitAI.prototype.UnitFsmSpec = {
|
1168 | 1170 | "enter": function(msg) { |
1169 | 1171 | var target = this.order.data.target; |
1170 | 1172 | var allowCapture = this.order.data.allowCapture; |
| 1173 | var attackType = this.order.data.attackType; |
1171 | 1174 | // Check if we are already in range, otherwise walk there |
1172 | | if (!this.CheckTargetAttackRange(target, target)) |
| 1175 | if (!this.CheckTargetAttackRange(target, attackType)) |
1173 | 1176 | { |
1174 | 1177 | if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) |
1175 | 1178 | { |
… |
… |
UnitAI.prototype.UnitFsmSpec = {
|
1192 | 1195 | "Timer": function(msg) { |
1193 | 1196 | var target = this.order.data.target; |
1194 | 1197 | var allowCapture = this.order.data.allowCapture; |
| 1198 | var attackType = this.order.data.attackType; |
1195 | 1199 | // Check if we are already in range, otherwise walk there |
1196 | | if (!this.CheckTargetAttackRange(target, target)) |
| 1200 | if (!this.CheckTargetAttackRange(target, attackType)) |
1197 | 1201 | { |
1198 | 1202 | if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) |
1199 | 1203 | { |