Skip to content

Commit

Permalink
longturn#2478 Trigger bounce failure callback before unloading transport
Browse files Browse the repository at this point in the history
  • Loading branch information
XHawk87 authored and lmoureaux committed Jan 6, 2025
1 parent f47cde2 commit 1f5d461
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/unittools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,10 @@ void bounce_unit(struct unit *punit, int max_distance,
}
}

if (on_failure) {
on_failure({.bunit = punit});
}

/* Didn't find a place to bounce the unit, going to disband it.
* Try to bounce transported units. */
if (0 < get_transporter_occupancy(punit)) {
Expand All @@ -1428,10 +1432,6 @@ void bounce_unit(struct unit *punit, int max_distance,
}
}

if (on_failure) {
on_failure({.bunit = punit});
}

wipe_unit(punit, ULR_STACK_CONFLICT, nullptr);
}

Expand Down

0 comments on commit 1f5d461

Please sign in to comment.