Skip to content

Commit

Permalink
call StopPirating() if moving off also for AutoAddOrders and AutoAddO…
Browse files Browse the repository at this point in the history
…rdersWrongTurn:

since it won't hurt if not used but would ensure behavior acco. to 58050b8 if called
  • Loading branch information
LynxAbraxas committed Apr 30, 2019
1 parent 58050b8 commit 9265b34
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ctp2_code/gs/gameobj/ArmyData.cpp
Expand Up @@ -6054,7 +6054,11 @@ void ArmyData::AutoAddOrders(UNIT_ORDER_TYPE order, Path *path,
}

m_orders->AddTail(new Order(order, path, point, argument));
StopPirating(); // why?

if(point != m_pos || order != UNIT_ORDER_INTERCEPT_TRADE){
fprintf(stderr, "%s L%d: AddOrders\n", __FILE__, __LINE__);
StopPirating(); // to ensure trade route is not regarded as pirated when moving off (which is not possible any more on the new position, see https://github.com/civctp2/civctp2/issues/75
}

if(m_owner >= 0 && m_owner < k_MAX_PLAYERS && g_player[m_owner])
{
Expand Down Expand Up @@ -6092,7 +6096,11 @@ void ArmyData::AutoAddOrdersWrongTurn(UNIT_ORDER_TYPE order, Path *path,
ClearOrders();

m_orders->AddTail(new Order(order, path, point, argument));
StopPirating(); // why?

if(point != m_pos || order != UNIT_ORDER_INTERCEPT_TRADE){
fprintf(stderr, "%s L%d: AddOrders\n", __FILE__, __LINE__);
StopPirating(); // to ensure trade route is not regarded as pirated when moving off (which is not possible any more on the new position, see https://github.com/civctp2/civctp2/issues/75
}

if(m_owner >= 0 && m_owner < k_MAX_PLAYERS && g_player[m_owner]) {
ExecuteOrders(false);
Expand Down

0 comments on commit 9265b34

Please sign in to comment.