← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1658668-sp-ai into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1658668-sp-ai into lp:widelands.

Commit message:
Do not change the AI settings when toggling single player slots on/off.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1658668 in widelands: "Menu Launch Game: Switching AI player on/off changes AI setting"
  https://bugs.launchpad.net/widelands/+bug/1658668

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1658668-sp-ai/+merge/346910
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1658668-sp-ai into lp:widelands.
=== modified file 'src/wui/playerdescrgroup.cc'
--- src/wui/playerdescrgroup.cc	2018-04-27 06:11:05 +0000
+++ src/wui/playerdescrgroup.cc	2018-05-26 08:56:33 +0000
@@ -214,11 +214,13 @@
 		return;
 
 	if (on) {
-		if (settings.players[d->plnum].state == PlayerSettings::State::kClosed)
-			d->settings->next_player_state(d->plnum);
+		if (settings.players[d->plnum].state == PlayerSettings::State::kClosed) {
+			d->settings->set_player_state(d->plnum, PlayerSettings::State::kComputer);
+		}
 	} else {
-		if (settings.players[d->plnum].state != PlayerSettings::State::kClosed)
+		if (settings.players[d->plnum].state != PlayerSettings::State::kClosed) {
 			d->settings->set_player_state(d->plnum, PlayerSettings::State::kClosed);
+		}
 	}
 }
 


Follow ups