Permalink
Browse files

Don't try to get HealthComponent for specs in TeamInfoMessage

  • Loading branch information...
DolceTriade committed Dec 28, 2015
1 parent 2a6280a commit d91bb1f706061669c4115b1f5b42399fd9ae0a4a
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/sgame/sg_team.cpp
@@ -380,6 +380,7 @@ void TeamplayInfoMessage( gentity_t *ent )
gclient_t *cl;
upgrade_t upgrade = UP_NONE;
int curWeaponClass = WP_NONE; // sends weapon for humans, class for aliens
int health = 0;

if ( !g_allowTeamOverlay.integer )
{
@@ -456,26 +457,28 @@ void TeamplayInfoMessage( gentity_t *ent )
{
upgrade = UP_NONE;
}
health = static_cast<int>( std::ceil( player->entity->Get<HealthComponent>()->Health() ) );
}
else if ( cl->pers.team == TEAM_ALIENS )
{
curWeaponClass = cl->ps.stats[ STAT_CLASS ];
upgrade = UP_NONE;
health = static_cast<int>( std::ceil( player->entity->Get<HealthComponent>()->Health() ) );
}

if( team == TEAM_ALIENS ) // aliens don't have upgrades
{
Com_sprintf( entry, sizeof( entry ), " %i %i %i %i %i", i,
cl->pers.location,
std::max((int)std::ceil(player->entity->Get<HealthComponent>()->Health()), 0),
health,
curWeaponClass,
cl->pers.credit );
}
else
{
Com_sprintf( entry, sizeof( entry ), " %i %i %i %i %i %i", i,
cl->pers.location,
std::max((int)std::ceil(player->entity->Get<HealthComponent>()->Health()), 0),
health,
curWeaponClass,
cl->pers.credit,
upgrade );

0 comments on commit d91bb1f

Please sign in to comment.