You have to call the GetCheatInterface() from the GlobalAICallback you get in the GlobalAI::Init(). This returns a pointer to a AICheats class or NULL if in a multiplayer game (incidentally, making a check of whether or not the AI is in a multiplayer game).
If it returns the valid pointer, it also turns on cheating in the game.
So, add something like this to the GlobalAI class in the header:
Code: Select all
AICheats *Cheater;
bool Cheating;
bool NetworkGame;
Code: Select all
Cheater = GlobalAICallback->GetCheatInterface();
if(Cheater != NULL)
{
// Can Cheat
Cheating = NetworkGame = true;
}
else
{
// Can't Cheat
Cheating = NetworkGame = false;
}