Eluna: fix compatibility with new guid changes, fix bg methods for cata

This commit is contained in:
Rochet2
2014-09-20 17:27:42 +03:00
parent ea6f6bcff2
commit 16185423ab
3 changed files with 23 additions and 10 deletions

View File

@@ -77,7 +77,11 @@ namespace LuaBattleGround
*/ */
int GetEndTime(lua_State* L, BattleGround* bg) int GetEndTime(lua_State* L, BattleGround* bg)
{ {
#ifdef CATA
Eluna::Push(L, bg->GetRemainingTime());
#else
Eluna::Push(L, bg->GetEndTime()); Eluna::Push(L, bg->GetEndTime());
#endif
return 1; return 1;
} }

View File

@@ -41,10 +41,6 @@ typedef uint64 ObjectGuid;
#define GET_GUID GetGUID #define GET_GUID GetGUID
#else #else
typedef QueryNamedResult ElunaQuery; typedef QueryNamedResult ElunaQuery;
#define MAKE_NEW_GUID(l, e, h) ObjectGuid(h, e, l)
#define GUID_ENPART(guid) ObjectGuid(guid).GetEntry()
#define GUID_LOPART(guid) ObjectGuid(guid).GetCounter()
#define GUID_HIPART(guid) ObjectGuid(guid).GetHigh()
#define ASSERT MANGOS_ASSERT #define ASSERT MANGOS_ASSERT
#define ELUNA_LOG_INFO(...) sLog.outString(__VA_ARGS__); #define ELUNA_LOG_INFO(...) sLog.outString(__VA_ARGS__);
#define ELUNA_LOG_ERROR(...) sLog.outErrorEluna(__VA_ARGS__); #define ELUNA_LOG_ERROR(...) sLog.outErrorEluna(__VA_ARGS__);
@@ -64,6 +60,19 @@ typedef QueryNamedResult ElunaQuery;
#define UNORDERED_SET std::unordered_set #define UNORDERED_SET std::unordered_set
#endif #endif
#ifndef MAKE_NEW_GUID
#define MAKE_NEW_GUID(l, e, h) ObjectGuid(h, e, l)
#endif
#ifndef GUID_ENPART
#define GUID_ENPART(guid) ObjectGuid(guid).GetEntry()
#endif
#ifndef GUID_LOPART
#define GUID_LOPART(guid) ObjectGuid(guid).GetCounter()
#endif
#ifndef GUID_HIPART
#define GUID_HIPART(guid) ObjectGuid(guid).GetHigh()
#endif
class Unit; class Unit;
class WorldObject; class WorldObject;

View File

@@ -203,25 +203,25 @@ namespace LuaMap
switch (GUID_HIPART(guid)) switch (GUID_HIPART(guid))
{ {
case HIGHGUID_PLAYER: case HIGHGUID_PLAYER:
Eluna::Push(L, sObjectAccessor->GetObjectInMap(guid, map, (Player*)NULL)); Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Player*)NULL));
break; break;
case HIGHGUID_TRANSPORT: case HIGHGUID_TRANSPORT:
case HIGHGUID_MO_TRANSPORT: case HIGHGUID_MO_TRANSPORT:
case HIGHGUID_GAMEOBJECT: case HIGHGUID_GAMEOBJECT:
Eluna::Push(L, sObjectAccessor->GetObjectInMap(guid, map, (GameObject*)NULL)); Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (GameObject*)NULL));
break; break;
case HIGHGUID_VEHICLE: case HIGHGUID_VEHICLE:
case HIGHGUID_UNIT: case HIGHGUID_UNIT:
Eluna::Push(L, sObjectAccessor->GetObjectInMap(guid, map, (Creature*)NULL)); Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Creature*)NULL));
break; break;
case HIGHGUID_PET: case HIGHGUID_PET:
Eluna::Push(L, sObjectAccessor->GetObjectInMap(guid, map, (Pet*)NULL)); Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Pet*)NULL));
break; break;
case HIGHGUID_DYNAMICOBJECT: case HIGHGUID_DYNAMICOBJECT:
Eluna::Push(L, sObjectAccessor->GetObjectInMap(guid, map, (DynamicObject*)NULL)); Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (DynamicObject*)NULL));
break; break;
case HIGHGUID_CORPSE: case HIGHGUID_CORPSE:
Eluna::Push(L, sObjectAccessor->GetObjectInMap(guid, map, (Corpse*)NULL)); Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Corpse*)NULL));
break; break;
default: default:
break; break;