Skip to content

Commit

Permalink
Fixed|Bindings: Local player controls applied to all players
Browse files Browse the repository at this point in the history
Fixes the problem where in multiplayer games, remote players would
undergo spurious movements in rhythm with the local player.

`P_ConsoleToLocal` returns -1 if the console isn't local. However,
when iterating through bindings, -1 was interpreted to mean "iterate
everything" rather than restricting the iteration to a single player.

IssueID #2099
  • Loading branch information
skyjake committed Jul 10, 2015
1 parent 10427ca commit 997f4df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doomsday/apps/client/include/world/p_players.h
Expand Up @@ -58,6 +58,11 @@ int P_LocalToConsole(int localPlayer);
/**
* Determine the local player number used by a particular console. Local
* players are numbered starting from zero.
*
* @param playerNum Console number.
*
* @return Local player number. Returns -1 if @a playerNum does not correspond
* to any local player.
*/
int P_ConsoleToLocal(int playerNum);

Expand Down
2 changes: 2 additions & 0 deletions doomsday/apps/client/src/ui/b_util.cpp
Expand Up @@ -507,6 +507,8 @@ void B_EvaluateImpulseBindings(BindContext *context, int localNum, int impulseId

*pos = 0;
*relativeOffset = 0;

if(localNum < 0 || localNum >= DDMAXPLAYERS) return; // No local player specified.

uint const nowTime = Timer_RealMilliseconds();
bool conflicted[NUM_IBD_TYPES]; de::zap(conflicted);
Expand Down

0 comments on commit 997f4df

Please sign in to comment.