Skip to content

Added support for Player.desired_player_class to DOD:S. (#475) #477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/modules/players/players_entity.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -745,12 +745,12 @@ void PlayerMixin::SetSuitPowerLoad(float value)

unsigned char PlayerMixin::GetDesiredPlayerClass()
{
static int offset = FindNetworkPropertyOffset("m_Shared.m_iDesiredPlayerClass");
static int offset = FindNetworkPropertyOffset(DESIRED_PLAYER_CLASS_PROPERTY);
return GetNetworkPropertyByOffset<unsigned char>(offset);
}

void PlayerMixin::SetDesiredPlayerClass(unsigned char value)
{
static int offset = FindNetworkPropertyOffset("m_Shared.m_iDesiredPlayerClass");
static int offset = FindNetworkPropertyOffset(DESIRED_PLAYER_CLASS_PROPERTY);
SetNetworkPropertyByOffset<unsigned char>(offset, value);
}
9 changes: 9 additions & 0 deletions src/core/modules/players/players_entity.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,19 @@ using namespace boost::python;
// Player class property
#if defined(ENGINE_BRANCH_TF2)
#define PLAYER_CLASS_PROPERTY "m_PlayerClass.m_iClass"
#elif defined(ENGINE_BRANCH_DODS)
#define PLAYER_CLASS_PROPERTY "m_Shared.dodsharedlocaldata.m_iPlayerClass"
#else
#define PLAYER_CLASS_PROPERTY "m_iClass"
#endif

// Desired Player class property
#if defined(ENGINE_BRANCH_DODS)
#define DESIRED_PLAYER_CLASS_PROPERTY "m_Shared.dodsharedlocaldata.m_iDesiredPlayerClass"
#else
#define DESIRED_PLAYER_CLASS_PROPERTY "m_Shared.m_iDesiredPlayerClass"
#endif


//-----------------------------------------------------------------------------
// CBaseEntity extension class for players.
Expand Down