05-09-2015, 09:38 PM
Anyone know why cWorld:GetNumPlayers is commented out? It could be used to make thunder work correctly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 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); |