Opened 8 years ago

Last modified 3 years ago

#4189 new defect

Capture attack doesn't work for unit with a buildingAI

Reported by: fatherbushido Owned by: Freagarach
Priority: Must Have Milestone: Work In Progress
Component: Simulation Keywords:
Cc: Phab:D1819 Patch: Phab:D1819

Description (last modified by fatherbushido)

Since r16907 (see #3356), Siege Tower has a capture attack (wich makes sense). As for other units we can have both a capture attack and another attack, here we have a problem. When targetting a building, we show the capture attack pointer, then the siege tower stay idle near the building. So the capture attack doesn't work for a unit with a BuildingAI. Indeed, it's implemented like that in L1897-L1903 of UnitAI.js

// BuildingAI has it's own attack-routine
if (!cmpBuildingAI)
{
    let cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
    cmpAttack.PerformAttack(this.order.data.attackType, target);
}

replacing if (!cmpBuildingAI) by if (!cmpBuildingAI) || this.order.data.attackType != "ranged" fixes that but would hide the need to split the multiple arrow attack logic for structures and units.

See also #252 and #4000 for related (in a way or another) tickets.

Change History (9)

comment:1 by fatherbushido, 8 years ago

In 18766:

Reverts r16907 as capture doesn't work for units with BuildingAI. Refs #3356, #4189, #4000.

comment:2 by fatherbushido, 8 years ago

in fact r17784 broke that

comment:3 by fatherbushido, 7 years ago

Description: modified (diff)

comment:4 by fatherbushido, 7 years ago

Description: modified (diff)

comment:5 by Imarok, 5 years ago

Component: UI & SimulationSimulation

Move tickets to Simulation as UI & Simulation got some sub components.

comment:7 by Stan, 5 years ago

Cc: Phab:D1819 added

comment:8 by Freagarach, 5 years ago

Milestone: BacklogWork In Progress
Patch: Phab:D1819

comment:9 by Silier, 3 years ago

Owner: set to Freagarach
Note: See TracTickets for help on using tickets.