Remove DeleteBonesFromWorld method from corpse and fix build for TC

This commit is contained in:
Rochet2
2015-11-09 17:56:17 +02:00
parent e41fed0c0d
commit c94ef51cbe
5 changed files with 22 additions and 17 deletions

View File

@@ -77,19 +77,5 @@ namespace LuaCorpse
corpse->SaveToDB();
return 0;
}
/**
* Deletes the [Corpse] from the world.
*
* If the [Corpse]'s type is not BONES then this does nothing.
*/
int DeleteBonesFromWorld(Eluna* /*E*/, lua_State* /*L*/, Corpse* corpse)
{
// Prevent a failed assertion.
if (corpse->GetType() != CORPSE_BONES)
return 0;
corpse->DeleteBonesFromWorld();
return 0;
}
};
#endif

View File

@@ -592,7 +592,10 @@ namespace LuaCreature
uint32 spell = Eluna::CHECKVAL<uint32>(L, 2);
#ifdef TRINITY
Eluna::Push(L, creature->GetSpellHistory()->GetRemainingCooldown(spell));
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell))
Eluna::Push(L, creature->GetSpellHistory()->GetRemainingCooldown(spellInfo));
else
Eluna::Push(L, 0);
#else
Eluna::Push(L, creature->GetCreatureSpellCooldownDelay(spell));
#endif

View File

@@ -41,6 +41,20 @@ typedef QueryResult ElunaQuery;
#define ELUNA_LOG_ERROR(...) TC_LOG_ERROR("eluna", __VA_ARGS__);
#define ELUNA_LOG_DEBUG(...) TC_LOG_DEBUG("eluna", __VA_ARGS__);
#define GET_GUID GetGUID
#define HIGHGUID_PLAYER HighGuid::Player
#define HIGHGUID_UNIT HighGuid::Unit
#define HIGHGUID_ITEM HighGuid::Item
#define HIGHGUID_GAMEOBJECT HighGuid::GameObject
#define HIGHGUID_PET HighGuid::Pet
#define HIGHGUID_TRANSPORT HighGuid::Transport
#define HIGHGUID_VEHICLE HighGuid::Vehicle
#define HIGHGUID_CONTAINER HighGuid::Container
#define HIGHGUID_DYNAMICOBJECT HighGuid::DynamicObject
#define HIGHGUID_CORPSE HighGuid::Corpse
#define HIGHGUID_MO_TRANSPORT HighGuid::Mo_Transport
#define HIGHGUID_INSTANCE HighGuid::Instance
#define HIGHGUID_GROUP HighGuid::Group
#else
typedef QueryNamedResult ElunaQuery;
#define ASSERT MANGOS_ASSERT

View File

@@ -1226,7 +1226,6 @@ ElunaRegister<Corpse> CorpseMethods[] =
// Other
{ "ResetGhostTime", &LuaCorpse::ResetGhostTime },
{ "SaveToDB", &LuaCorpse::SaveToDB },
{ "DeleteBonesFromWorld", &LuaCorpse::DeleteBonesFromWorld },
{ NULL, NULL }
};

View File

@@ -817,7 +817,10 @@ namespace LuaPlayer
uint32 spellId = Eluna::CHECKVAL<uint32>(L, 2);
#ifdef TRINITY
Eluna::Push(L, player->GetSpellHistory()->GetRemainingCooldown(spellId));
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId))
Eluna::Push(L, player->GetSpellHistory()->GetRemainingCooldown(spellInfo));
else
Eluna::Push(L, 0);
#else
Eluna::Push(L, uint32(player->GetSpellCooldownDelay(spellId)));
#endif