From: Holger Schemel Date: Fri, 18 May 2018 08:39:00 +0000 (+0200) Subject: fixed network games, part 3: enabled mapping input to reassigned players X-Git-Tag: 4.1.1.0~177 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=fa2828673ea52a8b0419eb8e57b95df6c8ff29b2 fixed network games, part 3: enabled mapping input to reassigned players Before this change, player input from connected network players was only allowed for active players. However, the old code did not take into account that players may have been reassigned to other players in the level playfield, so their input actions have to be mapped to that different player. This change accepts input actions for all players, and later maps them to the finally assigned player in the game. --- diff --git a/src/network.c b/src/network.c index afce7998..b51402eb 100644 --- a/src/network.c +++ b/src/network.c @@ -508,7 +508,7 @@ static void Handle_OP_MOVE_PLAYER(unsigned int len) /* copy valid player actions */ for (i = 0; i < MAX_PLAYERS; i++) stored_player[i].effective_action = - (i < len - 6 && stored_player[i].active ? buffer[6 + i] : 0); + (i < len - 6 ? buffer[6 + i] : 0); network_player_action_received = TRUE; }