[1.40] Flag Hud Score Fix

lemon

8====D
Veteran XV
This fix applies to players on active mode servers like US Base and The Community.

  • The built-in 1.40 flag hud doesn't update team scores when you join a server mid-game.
  • In config\Core\Team.cs make the following change.


Instead of this:
Code:
function remoteTeamScore( %sv, %team, %score ) {
	//$Team::Score[%team] = %score;
}


Make it look like this:
Code:
function remoteTeamScore( %sv, %team, %score ) {
	$Team::Score[%team] = %score;
}
 
Last edited:
It was bothering me that the flag hud didn't update when the server sent the info via remote. I was looking at the team functions thinking about a presto style team hud when I saw it. I was like :ugh:
 
The funny part is I think I figured this out 3 or 4 years ago via the same solution

 zadmin was broken then too 
 
I'll try to explain what's going on if anyone wants to know. When you try to register to a zAdmin server using an active client it will instantly tell you the current score. That step includes two calls to remoteTeamScore, one for each team. The fix is ignoring any remoteTeamScore call after those first two.

The correct fix would be to use following server side code:

Code:
zadmin::ActiveMessage::All(FlagCaptured, %enemyTeam, %playerClient);
zadmin::ActiveMessage::All(TeamScore, %playerTeam, $teamScore[%playerTeam]);

instead of the original code:
Code:
zadmin::ActiveMessage::All(TeamScore, %playerTeam, $teamScore[%playerTeam]);	
zadmin::ActiveMessage::All(FlagCaptured, %enemyTeam, %playerClient);

in Line 910 in objectives.cs in zAdmin.

zAdmin uses the 2nd version at the moment. What's wrong with it? Keep reading.

Explained:
Using the default zAdmin version, the client will get the info about the new score first, and therefore update .. but that piece of information is followed by a capture event, which will cause the client to increment the score once again, leading to a second, unwanted score incrementation. That's why the server code should be manipulated to send the capture event before the teamscore event is send.

US Base is fixed!
Shazbot.eu is fixed!
Community is fixed!
 
Last edited:
Back
Top