Opened 7 years ago

Closed 7 years ago

#4359 closed defect (duplicate)

UnitAI and unpacked unit with a unit in los but not still in range

Reported by: fatherbushido Owned by:
Priority: Should Have Milestone:
Component: UI & Simulation Keywords:
Cc: Patch:

Description (last modified by fatherbushido)

We have an unpacked unit A waiting for attacking a target T. Then a unit enter in los. UnitAI does his job, push the correct attack order and process the fsm message.

Target T enter is in los of unit A. The target T is still alive. We are not still in range so the CheckTargetAttackRange fails. And we are at L471 - L491:

		// For packable units out of attack range:
		// 1. If packed, we need to move to attack range and then unpack.
		// 2. If unpacked, we first need to pack, then follow case 1.
		var cmpPack = Engine.QueryInterface(this.entity, IID_Pack);
		if (cmpPack)
			// Ignore unforced attacks
			// TODO: use special stances instead?
			if (!

			if (this.CanPack())
				// Case 2: pack
				this.PushOrderFront("Pack", { "force": true });

So it ends.

I guess we should had something here to put handle something like unit A will keep the attack order and wait for the target to be in his range or something else (or still doing like that but adding something in queries) (And perhaps in the same move, implement that TODO about special stances).

Change History (4)

comment:1 by fatherbushido, 7 years ago

Description: modified (diff)

comment:2 by fatherbushido, 7 years ago

Description: modified (diff)

comment:3 by fatherbushido, 7 years ago

Description: modified (diff)

comment:4 by bb, 7 years ago

Milestone: Alpha 22
Resolution: duplicate
Status: newclosed

Duplicate of #2802. Will change description there so this research isn't lost.

Note: See TracTickets for help on using tickets.