Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #879880 » 3.0-illegal_action-fix-explanation-finding-order.patch

Sveinung Kvilhaugsvik, 2020-07-07 11:51 AM

View differences:

server/unithand.c
2485 2485
                                                 target_city, target_unit,
2486 2486
                                                 target_tile));
2487 2487

  
2488
  was_punished = illegal_action_pay_price(pplayer, information_revealed,
2489
                                          actor, stopped_action, tgt_player,
2490
                                          requester);
2491

  
2492
  if (disturb_player || was_punished) {
2493
    /* This is a foreground request or the actor unit was punished with
2494
     * the loss of movement points. */
2488
  if (disturb_player) {
2489
    /* This is a foreground request. */
2495 2490
    illegal_action_msg(pplayer, (information_revealed
2496 2491
                                 ? E_UNIT_ILLEGAL_ACTION : E_BAD_COMMAND),
2497 2492
                       actor, stopped_action_id,
2498 2493
                       target_tile, target_city, target_unit);
2499 2494
  }
2495

  
2496
  was_punished = illegal_action_pay_price(pplayer, information_revealed,
2497
                                          actor, stopped_action, tgt_player,
2498
                                          requester);
2499

  
2500
  if (!disturb_player && was_punished) {
2501
    /* FIXME: Temporary work around to prevent wrong information and/or
2502
     * crashes. See hrm Bug #879880 */
2503
    /* TODO: Get the explanation before the punishment and show it here.
2504
     * See hrm Bug #879881 */
2505
    notify_player(pplayer, unit_tile(actor),
2506
                  (information_revealed
2507
                   ? E_UNIT_ILLEGAL_ACTION : E_BAD_COMMAND), ftc_server,
2508
                  _("No explanation why you couldn't do %s. This is a bug."
2509
                    " Sorry about that. -- Sveinung"),
2510
                  action_id_name_translation(stopped_action_id));
2511
  }
2500 2512
}
2501 2513

  
2502 2514
/**************************************************************************
2503
- 
(2-2/3)