Skip to content

Commit

Permalink
Fix panda clones no longer cancel early #339
Browse files Browse the repository at this point in the history
  • Loading branch information
SMUnlimited committed Nov 21, 2024
1 parent cd87020 commit 1f108c2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

- Fix to avoid rare crashes in job thread.
- Fix to avoid a case where AMAI tries to buy more than one hero in tier 1 and when using the recalculate heros ai command.
- Fix Panda clones to not be canceled early when hero is going home or buying items.

## [3.4.0] - 2024-11-19

Expand Down
2 changes: 1 addition & 1 deletion Jobs/BUY_ITEM.eai
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ local integer detectedenemies = GetLocationNonCreepStrength(GetUnitX(shop_sent),
if GetSlotsFreeOnUnit(shop_sent) <= 0 and healing then
call DropNonHealingItem(shop_sent)
else
call IssueImmediateOrder(shop_sent, "stop")
call IssueImmediateOrder(shop_sent, "holdposition")
endif
set ismoving = false
if GetUnitTypeId(shop_unit) == old_id[racial_shop] then
Expand Down
2 changes: 1 addition & 1 deletion Jobs/BUY_NEUTRAL.eai
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function BuyNeutral takes integer id returns nothing
set dist = DistanceBetweenUnits(neutral_sent[nn], buy_place)
if dist < buy_distance then
call CreateDebugTag("buy unit", 10, neutral_sent[nn], 3.00, 1.50)
call IssueImmediateOrder(neutral_sent[nn], "stop")
call IssueImmediateOrder(neutral_sent[nn], "holdposition")
call IssueNeutralImmediateOrderById(ai_player, buy_place, old_id[id])
if buy_time_small[nn] < 0 then
set buy_time_small[nn] = current_time
Expand Down
2 changes: 1 addition & 1 deletion Jobs/BUY_NEUTRAL_HERO.eai
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function BuyNeutralHero takes integer id returns nothing
set time_next_try = 4
else
call CreateDebugTag("buy tavern hero", 10, buying_unit, 3.00, 1.50)
call IssueImmediateOrder(buying_unit, "stop")
call IssueImmediateOrder(buying_unit, "holdposition")
call IssueNeutralImmediateOrderById(ai_player, tavern, old_id[id])
set time_next_try = 0.5
endif
Expand Down
2 changes: 1 addition & 1 deletion Jobs/SEND_HOME.eai
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function SendUnitHomeJob takes unit u, integer p returns nothing
call TQAddUnitJob(4, SEND_HOME, p, u)
else
call CreateDebugTag("SEND_HOME Stop at Shop", 10, u, 3.00, 2.00)
call IssueImmediateOrder(u, "stop")
call IssueImmediateOrder(u, "holdposition") // use hold position as stop will cancel panda clones for the hero (and possibly other special abilities)
call IssueNeutralImmediateOrderById(ai_player, nearshopunit, old_id[racial_healing_item])
if GetUnitState(u, UNIT_STATE_MANA) < 100 and racial_mana_item != 0 and GetItemNumberOnUnit(racial_mana_item, u) <= 0 then
call IssueNeutralImmediateOrderById(ai_player, nearshopunit, old_id[racial_mana_item])
Expand Down

0 comments on commit 1f108c2

Please sign in to comment.