MantisBT - Zandronum
View Issue Details
0002166Zandronum[All Projects] Bugpublic2015-04-04 16:462018-09-30 21:39
Ch0wW 
Torr Samaho 
normalmajoralways
closedfixed 
AnyAnyAny
2.0 
2.12.1 
0002166: Last CTF capture isn't shown on scoreboard
In CTF, whenever someone captures the last flag before a scorelimit, it is NEVER added to the player's point list's scoreboard.

The problem lies by adding +1 to the teamscore BEFORE adding the point to the player.

Main Function problem seen in AFlag::HandlePickup

        if (( TEAM_GetSimpleCTFSTMode( )) && ( NETWORK_GetState( ) != NETSTATE_CLIENT ) && ( CLIENTDEMO_IsPlaying( ) == false ))
        {
            // Give his team a point.
            TEAM_SetScore( Owner->player->ulTeam, TEAM_GetScore( Owner->player->ulTeam ) + 1, true );
            Owner->player->lPointCount++;
1) Scorelimit 1;
2) Capture the flag;
3) Scoreboard: Points - 0
I never thought this problem was overlooked for so long.

Same point-giving error on these functions:

• FUNC( LS_Team_Score ) ► p_Inspec.cpp
• FUNC( LS_Team_GivePoints ) ► p_Inspec.cpp

• TEAM_ScoreSkulltagPoint ► team.cpp
• PLAYER_GivePossessionPoint ► p_interaction.cpp
• AWhiteFlag::HandlePickup ► g_shared/a_flags.cpp

Fix "template":

// Give his team a point.
Owner->player->lPointCount++;
TEAM_SetScore( Owner->player->ulTeam, TEAM_GetScore( Owner->player->ulTeam ) + 1, true );
            
No tags attached.
Issue History
2015-04-04 16:46Ch0wWNew Issue
2015-04-04 17:18Edward-sanNote Added: 0012021
2015-04-04 17:18Edward-sanStatusnew => feedback
2015-04-04 17:27Ch0wWNote Added: 0012022
2015-04-04 17:27Ch0wWStatusfeedback => new
2015-04-04 17:29Edward-sanNote Edited: 0012021bug_revision_view_page.php?bugnote_id=12021#r6909
2015-04-04 17:29Edward-sanStatusnew => feedback
2015-04-04 17:41DuskNote Added: 0012023
2015-04-04 17:54Torr SamahoNote Added: 0012024
2015-04-04 17:54Torr SamahoNote Edited: 0012024bug_revision_view_page.php?bugnote_id=12024#r6911
2015-04-04 17:55Torr SamahoAssigned To => Torr Samaho
2015-04-04 17:55Torr SamahoStatusfeedback => assigned
2015-04-04 18:23Torr SamahoNote Added: 0012026
2015-04-05 08:41Torr SamahoNote Added: 0012044
2015-04-05 13:20Ch0wWNote Added: 0012048
2015-04-05 19:29DuskNote Added: 0012053
2015-04-05 19:29DuskStatusassigned => resolved
2015-04-05 19:29DuskFixed in Version => 2.1
2015-04-05 19:29DuskResolutionopen => fixed
2015-04-05 19:29DuskTarget Version => 2.1
2018-09-30 21:39Blzut3Statusresolved => closed

Notes
(0012021)
Edward-san   
2015-04-04 17:18   
(edited on: 2015-04-04 17:29)
Does the issue happen also in a Team Possession game?


Sorry, not just Possession.

(0012022)
Ch0wW   
2015-04-04 17:27   
I listed on additionnal Notes all the functions that have the same problem.

Anyway, no, this problem does not happen on Possession, that gives player points BEFORE adding points to the teamscore.
(0012023)
Dusk   
2015-04-04 17:41   
I don't understand what the report says at all. The proposed "fix" is useless because of its bizarre nature. If you fixed this, please post an unified diff.
(0012024)
Torr Samaho   
2015-04-04 17:54   
The report looks reasonable to me. He just suggests to change the order in which

TEAM_SetScore( Owner->player->ulTeam, TEAM_GetScore( Owner->player->ulTeam ) + 1, true );

and

Owner->player->lPointCount++;

are called. This makes sense since TEAM_SetScore calls SERVERCONSOLE_UpdateScoreboard.

(0012026)
Torr Samaho   
2015-04-04 18:23   
I looked into this further and noticed that what I thought earlier is not the case. The point count of a player is never updated on the Windows server console since

SERVERCONSOLE_UpdatePlayerInfo ( ulPlayer, UDF_FRAGS );

is never called. I'll take care of this.
(0012044)
Torr Samaho   
2015-04-05 08:41   
I fixed the problem that the point count in the scoreboard of the Windows server console was never updated. I couldn't reproduce the timing problems you reported though. Does it still happen with the latest changes I made? If so, please report exactly how to reproduce the issue and, in particular, where the outdated value is still displayed. The in game scoreboard seemed to work fine for me in 2.0.
(0012048)
Ch0wW   
2015-04-05 13:20   
looks like it now works fine.
(0012053)
Dusk   
2015-04-05 19:29   
Was fixed by:'https://bitbucket.org/Torr_Samaho/zandronum/commits/a33c8415 [^]'