Exemplo n.º 1
0
//------------------------------------------------------------------------------
//void DoVoteAbstain(PlayerTypes iPlayer, int iNumVotes);
int CvLuaLeague::lDoVoteAbstain(lua_State* L)
{
	CvLeague* pLeague = GetInstance(L);
	const PlayerTypes ePlayer = (PlayerTypes) lua_tointeger(L, 2);
	const int iNumVotes = lua_tointeger(L, 3);

	pLeague->DoVoteAbstain(ePlayer, iNumVotes);
	return 0;
}
//------------------------------------------------------------------------------
void CvDllNetMessageHandler::ResponseLeagueVoteAbstain(LeagueTypes eLeague, PlayerTypes eVoter, int iNumVotes)
{
	CvAssertMsg(eLeague != NO_LEAGUE, "eLeague invalid");
	CvAssertMsg(eVoter != NO_PLAYER, "eVoter invalid");

	CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetLeague(eLeague);
	CvAssertMsg(pLeague->CanVote(eVoter), "eVoter not allowed to vote. Please send Anton your save file and version.");
	pLeague->DoVoteAbstain(eVoter, iNumVotes);
}