open-gunz/ogz-source

Fix TDM Mode

Opened this issue · 2 comments

Team Deathmatch round ending even when some players are alive on both teams. This occurs directly after a certain player dies (similar to assassination mode when it ends when the boss dies).

My assumption is that if the client doesn't report to the server that it's alive, then it doesn't get added to the round player count. This async state causes the round to end early.

MMatchObject.cpp MMatchObject::OnInitRound

  • Checks if the current player is a spectator. If not, sets the player to the alive status. Sets the round kill count to 0, the death count to 0, says that the player has joined the game, says the player has been dead for 0 seconds, and resets the HP and AP. It is called by...

MMatchStage.cpp MMatchStage::OnInitRound()

  • Seems to be the point where the players are tallied. It uses a for loop to count the amount of player objects in the stage. If the player has entered the battle, it calls object initRound. It then checks if the player is on the red or blue team, increments the counter for each team's player count, and then increments a total player level count. It is called by...

MMatchRule.cpp MMatchRule.InitRound()

  • Is the point at which the stage's next round is initialized, followed by world item initialization (global health/armor/ammo pick ups) and the time limit for the round is set.

One test may be to inject a second or two of delay between round initialization and round starting. This would have to happen right before it enters the for loop to read each player's state.

mhs02 commented

The origin of this bug has still not been found.
However, a dirty fix was applied in the igunz source, which seems to remedy the issue for now.

I will PR the fix sometime this weekend, as this bug is very very irritating for players.