05-09-2015, 09:38 PM
Anyone know why cWorld:GetNumPlayers is commented out? It could be used to make thunder work correctly.
int NumPlayers = GetNumPlayers(); class cThunderCaster : public cPlayerListCallback { int m_PlayerToCastThunderAt; int m_CurrentPlayer; virtual bool Item(cPlayer * a_Player) { if (m_CurrentPlayer != m_PlayerToCastThunderAt) { return false; } // Cast thunder somewhere around the player return true; } public: cThunderCaster(int a_PlayerToCastThunderAt) : m_PlayerToCastThunderAt(a_PlayerToCastThunderAt), m_CurrentPlayer(0) {} } ThunderCaster(GetTickRandomNumber(NumPlayers)); ForEachPlayer(ThunderCaster);