widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #11850
[Merge] lp:~widelands-dev/widelands/fix_resend_player_command_in_inputqueues into lp:widelands
SirVer has proposed merging lp:~widelands-dev/widelands/fix_resend_player_command_in_inputqueues into lp:widelands.
Commit message:
Check if we can_cat() in all InputQueues callback functions.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1735090 in widelands: "Replays crash when a training site construction window is open"
https://bugs.launchpad.net/widelands/+bug/1735090
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fix_resend_player_command_in_inputqueues/+merge/334614
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/fix_resend_player_command_in_inputqueues into lp:widelands.
=== modified file 'src/wui/inputqueuedisplay.cc'
--- src/wui/inputqueuedisplay.cc 2017-05-14 04:38:39 +0000
+++ src/wui/inputqueuedisplay.cc 2017-12-01 21:08:06 +0000
@@ -255,8 +255,10 @@
* Update priority when radiogroup has changed
*/
void InputQueueDisplay::radiogroup_changed(int32_t state) {
-
assert(type_ == Widelands::wwWARE);
+ if (!igb_.can_act(building_.owner().player_number())) {
+ return;
+ }
int32_t priority = 0;
@@ -273,7 +275,6 @@
default:
return;
}
-
igb_.game().send_player_set_ware_priority(building_, type_, index_, priority);
}
@@ -283,14 +284,17 @@
*/
void InputQueueDisplay::decrease_max_fill_clicked() {
assert(cache_max_fill_ > 0);
-
+ if (!igb_.can_act(building_.owner().player_number())) {
+ return;
+ }
igb_.game().send_player_set_input_max_fill(building_, index_, type_, cache_max_fill_ - 1);
}
void InputQueueDisplay::increase_max_fill_clicked() {
-
assert(cache_max_fill_ < queue_->get_max_size());
-
+ if (!igb_.can_act(building_.owner().player_number())) {
+ return;
+ }
igb_.game().send_player_set_input_max_fill(building_, index_, type_, cache_max_fill_ + 1);
}
Follow ups