NeotokyoRebuild / neo

NEOTOKYO Rebuild - Source SDK 2013 mod of NEOTOKYO
Other
11 stars 9 forks source link

Scoreboard - Get_Score -> GetRoundsWon #402

Closed nullsystem closed 1 week ago

nullsystem commented 1 week ago

Description

Toolchain

Agiel commented 1 week ago

Isn't it better to change how Get_Score works? I kinda assumed it already did the right thing. I mean if we're going to have a switch on game mode and everything I think it's the wrong place to put it in the scoreboard class. I'm not opposed to quick and dirty fixes, but you should make them as close as possible to where the actual fix is going to happen.

Rainyan commented 1 week ago

@Agiel As these are declared together in the C_Team class:

    virtual int     Get_Score( void );
    virtual int     Get_Deaths( void );
    virtual int     Get_Ping( void );

I'm assuming "score" here is basically a misnomer for "frags"/"XP"/whatever yardstick of individual player performance, tallied up for that whole team.

But I guess we could inherit a new CNEOTeam, and check NEO gamerules for whether it's CTG, etc etc, if we wanted to do this "proper".

Although then we'd have both GetRoundsWon and a virtual overridden Get_Score doing the same thing for that class. Imo, overriding Get_Score here would feel like we're fighting against what the engine design means by this value, and GetRoundsWon is the way to go. Lack of any interface docs/comments obviously doesn't help matters, but it is what it is.

AdamTadeusz commented 1 week ago

The server side Team class doesn't seem to offer that much help either,

//------------------------------------------------------------------------------------------------------------------
// SCORING
//-----------------------------------------------------------------------------
// Purpose: Add / Remove score for this team
//-----------------------------------------------------------------------------
void CTeam::AddScore( int iScore )
{
    m_iScore += iScore;
}

void CTeam::SetScore( int iScore )
{
    m_iScore = iScore;
}

Maybe just include a NEO HACK comment so we can find this easily later?

nullsystem commented 1 week ago

I think rain's suggestion of something like a CNEOTeam that can deal with more gamemodes would be the way to go, or ifndef NEO/set scores explicitly. But for now GetRoundsWon will do, which is already utilized in multiple places anyway.

nullsystem commented 1 week ago

Superseded by #410