An easy way to access current player data?

DaveMcW

Deity
Joined
Oct 8, 2002
Messages
6,489
In CvGameTextMgr.cpp, function getAttitudeString(), I am trying to censor some data if the human is looking at relations between two rivals.

Code:
void CvGameTextMgr::getAttitudeString(CvWStringBuffer& szBuffer, PlayerTypes ePlayer, PlayerTypes eTargetPlayer)
{
    PlayerTypes eObservingPlayer = ?????;
    bool bCensored = false;

    if (eObservingPlayer != ePlayer && eObservingPlayer != eTargetPlayer) {
        bCensored = true;
   }
...

Is there a way I can look up eObservingPlayer (the human), without adding it as a function parameter?
 
I assume that you don't actually care if AI1 can get information from this about AI2 and AI3, you just want to hide it from the human player. So, you may try

eObservingPlayer = GC.getGameINLINE().getActivePlayer();

In a MP game, it should be that each human player is the active player on their own machine. Your code must consider the possibility that no player is active; for example, many GameTextMgr functions are called by the civilopedia when no game is actually running. In this case the function will return NO_PLAYER.
 
Top Bottom