FTexture *FMugShot::GetFace(player_t *player, const char *default_face, int accuracy, StateFlags stateflags) { int angle = UpdateState(player, stateflags); int level = 0; int max = player->mo->MugShotMaxHealth; if (max < 0) { max = player->mo->GetMaxHealth(); } else if (max == 0) { max = 100; } // [BB] If the consoleplayer isn't allowed to know this player's healt, pretend he is at full health for the mugshot. while ( ( SERVER_IsPlayerAllowedToKnowHealth( consoleplayer, static_cast<ULONG>( player - players )) ? player->health : max ) < (accuracy - 1 - level) * (max / accuracy)) { level++; } if (CurrentState != NULL) { const char *skin_face = player->morphTics ? player->MorphedPlayerClass->Meta.GetMetaString(APMETA_Face) : skins[player->userinfo.skin].face; return CurrentState->GetCurrentFrameTexture(default_face, skin_face, level, angle); } return NULL; }
//--------------------------------------------------------------------------- // // [TP] // //--------------------------------------------------------------------------- static bool ShouldDrawHealth( player_t* CPlayer ) { if ( CPlayer->bSpectating ) return false; if ( NETWORK_InClientMode() && ( SERVER_IsPlayerAllowedToKnowHealth( consoleplayer, CPlayer - players )) == false ) { return false; } return true; }