Change Eluna to a global variable

Remove Eluna* from being passed. You can now get it through Eluna::GetEluna(L)
Change function call cleanup to lua_settop instead of manual loop
Explicitly delete the copy constructor and copy assignment operators
This commit is contained in:
Rochet2
2017-03-19 15:48:48 +02:00
parent 8d3433f4b5
commit b7c379a42c
23 changed files with 990 additions and 976 deletions

View File

@@ -26,7 +26,7 @@ namespace LuaAura
*
* @return [Unit] caster
*/
int GetCaster(Eluna* /*E*/, lua_State* L, Aura* aura)
int GetCaster(lua_State* L, Aura* aura)
{
Eluna::Push(L, aura->GetCaster());
return 1;
@@ -37,7 +37,7 @@ namespace LuaAura
*
* @return string caster_guid : the GUID of the Unit as a decimal string
*/
int GetCasterGUID(Eluna* /*E*/, lua_State* L, Aura* aura)
int GetCasterGUID(lua_State* L, Aura* aura)
{
#ifndef TRINITY
Eluna::Push(L, aura->GetCasterGuid());
@@ -52,7 +52,7 @@ namespace LuaAura
*
* @return uint32 caster_level
*/
int GetCasterLevel(Eluna* /*E*/, lua_State* L, Aura* aura)
int GetCasterLevel(lua_State* L, Aura* aura)
{
Eluna::Push(L, aura->GetCaster()->getLevel());
return 1;
@@ -63,7 +63,7 @@ namespace LuaAura
*
* @return int32 duration : amount of time left in milliseconds
*/
int GetDuration(Eluna* /*E*/, lua_State* L, Aura* aura)
int GetDuration(lua_State* L, Aura* aura)
{
#ifndef TRINITY
Eluna::Push(L, aura->GetAuraDuration());
@@ -78,7 +78,7 @@ namespace LuaAura
*
* @return uint32 aura_id
*/
int GetAuraId(Eluna* /*E*/, lua_State* L, Aura* aura)
int GetAuraId(lua_State* L, Aura* aura)
{
Eluna::Push(L, aura->GetId());
return 1;
@@ -92,7 +92,7 @@ namespace LuaAura
*
* @return int32 max_duration : the maximum duration of the Aura, in milliseconds
*/
int GetMaxDuration(Eluna* /*E*/, lua_State* L, Aura* aura)
int GetMaxDuration(lua_State* L, Aura* aura)
{
#ifndef TRINITY
Eluna::Push(L, aura->GetAuraMaxDuration());
@@ -109,7 +109,7 @@ namespace LuaAura
*
* @return uint32 stack_amount
*/
int GetStackAmount(Eluna* /*E*/, lua_State* L, Aura* aura)
int GetStackAmount(lua_State* L, Aura* aura)
{
Eluna::Push(L, aura->GetStackAmount());
return 1;
@@ -120,7 +120,7 @@ namespace LuaAura
*
* @return [Unit] owner
*/
int GetOwner(Eluna* /*E*/, lua_State* L, Aura* aura)
int GetOwner(lua_State* L, Aura* aura)
{
#ifndef TRINITY
Eluna::Push(L, aura->GetTarget());
@@ -135,7 +135,7 @@ namespace LuaAura
*
* @param int32 duration : the new duration of the Aura, in milliseconds
*/
int SetDuration(Eluna* /*E*/, lua_State* L, Aura* aura)
int SetDuration(lua_State* L, Aura* aura)
{
int32 duration = Eluna::CHECKVAL<int32>(L, 2);
#ifndef TRINITY
@@ -159,7 +159,7 @@ namespace LuaAura
*
* @param int32 duration : the new maximum duration of the Aura, in milliseconds
*/
int SetMaxDuration(Eluna* /*E*/, lua_State* L, Aura* aura)
int SetMaxDuration(lua_State* L, Aura* aura)
{
int32 duration = Eluna::CHECKVAL<int32>(L, 2);
#ifndef TRINITY
@@ -183,7 +183,7 @@ namespace LuaAura
*
* @param uint32 amount
*/
int SetStackAmount(Eluna* /*E*/, lua_State* L, Aura* aura)
int SetStackAmount(lua_State* L, Aura* aura)
{
uint8 amount = Eluna::CHECKVAL<uint8>(L, 2);
#ifndef TRINITY
@@ -197,7 +197,7 @@ namespace LuaAura
/**
* Remove this [Aura] from the [Unit] it is applied to.
*/
int Remove(Eluna* /*E*/, lua_State* L, Aura* aura)
int Remove(lua_State* L, Aura* aura)
{
#ifndef TRINITY
aura->GetTarget()->RemoveSpellAuraHolder(aura->GetHolder(), AURA_REMOVE_BY_CANCEL);