mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
AZEROTHCORE compatibility (#271)
* Done Compatible AZEROTHCORE. * Fix TC build * Try fix whitespace (trailing and tabs2spaces) * Remove undefs and TC_LOG defines * Revert indentation change * Indentation and style change * Add more possible SQL types to query * change bg hooks OnBGEnd parameter type.
This commit is contained in:
@@ -35,7 +35,11 @@ namespace LuaBattleGround
|
||||
{
|
||||
uint32 team = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
#ifndef AZEROTHCORE
|
||||
Eluna::Push(L, bg->GetAlivePlayersCountByTeam((Team)team));
|
||||
#else
|
||||
Eluna::Push(L, bg->GetAlivePlayersCountByTeam((TeamId)team));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -64,6 +68,7 @@ namespace LuaBattleGround
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef AZEROTHCORE
|
||||
/**
|
||||
* Returns the bracket ID of the specific [BattleGround].
|
||||
*
|
||||
@@ -74,6 +79,7 @@ namespace LuaBattleGround
|
||||
Eluna::Push(L, bg->GetBracketId());
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns the end time of the [BattleGround].
|
||||
@@ -100,7 +106,11 @@ namespace LuaBattleGround
|
||||
{
|
||||
uint32 team = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
#ifndef AZEROTHCORE
|
||||
Eluna::Push(L, bg->GetFreeSlotsForTeam((Team)team));
|
||||
#else
|
||||
Eluna::Push(L, bg->GetFreeSlotsForTeam((TeamId)team));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -133,7 +143,11 @@ namespace LuaBattleGround
|
||||
*/
|
||||
int GetTypeId(lua_State* L, BattleGround* bg)
|
||||
{
|
||||
#ifndef AZEROTHCORE
|
||||
Eluna::Push(L, bg->GetTypeID());
|
||||
#else
|
||||
Eluna::Push(L, bg->GetBgTypeID());
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -166,7 +180,11 @@ namespace LuaBattleGround
|
||||
*/
|
||||
int GetMaxPlayers(lua_State* L, BattleGround* bg)
|
||||
{
|
||||
#ifndef AZEROTHCORE
|
||||
Eluna::Push(L, bg->GetMaxPlayers());
|
||||
#else
|
||||
Eluna::Push(L, bg->GetMaxPlayersPerTeam() * 2);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -177,7 +195,11 @@ namespace LuaBattleGround
|
||||
*/
|
||||
int GetMinPlayers(lua_State* L, BattleGround* bg)
|
||||
{
|
||||
#ifndef AZEROTHCORE
|
||||
Eluna::Push(L, bg->GetMinPlayers());
|
||||
#else
|
||||
Eluna::Push(L, bg->GetMaxPlayersPerTeam() * 2);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user