From 4784c2052a0acdcbc9dfa4094be9ad9bc494bc28 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Sat, 20 Sep 2014 22:07:24 +0300 Subject: [PATCH] Eluna: Correct whitespace --- BattleGroundMethods.h | 2 +- CreatureMethods.h | 66 ++++---- ElunaBinding.h | 8 +- ElunaUtility.cpp | 6 +- ElunaUtility.h | 2 +- GlobalMethods.h | 66 ++++---- HookMgr.cpp | 30 ++-- ItemMethods.h | 12 +- LuaEngine.cpp | 351 +++++++++++++++++++++--------------------- LuaFunctions.cpp | 2 +- MapMethods.h | 48 +++--- PlayerMethods.h | 16 +- QuestMethods.h | 4 +- WeatherMethods.h | 2 +- 14 files changed, 308 insertions(+), 307 deletions(-) diff --git a/BattleGroundMethods.h b/BattleGroundMethods.h index 0f17b19..3b577f6 100644 --- a/BattleGroundMethods.h +++ b/BattleGroundMethods.h @@ -11,7 +11,7 @@ namespace LuaBattleGround { /** * Returns the name of the [Battleground] - * + * * @return string name */ int GetName(lua_State* L, BattleGround* bg) diff --git a/CreatureMethods.h b/CreatureMethods.h index d575ba9..2dc8d84 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -626,7 +626,7 @@ namespace LuaCreature #else creature->SetHomePosition(x, y, z, o); #endif - + return 0; } @@ -694,37 +694,37 @@ namespace LuaCreature switch (targetType) { - case SELECT_TARGET_NEAREST: - case SELECT_TARGET_TOPAGGRO: - { - std::list::const_iterator itr = targetList.begin(); - if (position) - std::advance(itr, position); - Eluna::Push(L, *itr); - } - break; - case SELECT_TARGET_FARTHEST: - case SELECT_TARGET_BOTTOMAGGRO: - { - std::list::reverse_iterator ritr = targetList.rbegin(); - if (position) - std::advance(ritr, position); - Eluna::Push(L, *ritr); - } - break; - case SELECT_TARGET_RANDOM: - { - std::list::const_iterator itr = targetList.begin(); - if (position) - std::advance(itr, urand(0, position)); - else - std::advance(itr, urand(0, targetList.size()-1)); - Eluna::Push(L, *itr); - } - break; - default: - luaL_argerror(L, 2, "SelectAggroTarget expected"); - break; + case SELECT_TARGET_NEAREST: + case SELECT_TARGET_TOPAGGRO: + { + std::list::const_iterator itr = targetList.begin(); + if (position) + std::advance(itr, position); + Eluna::Push(L, *itr); + } + break; + case SELECT_TARGET_FARTHEST: + case SELECT_TARGET_BOTTOMAGGRO: + { + std::list::reverse_iterator ritr = targetList.rbegin(); + if (position) + std::advance(ritr, position); + Eluna::Push(L, *ritr); + } + break; + case SELECT_TARGET_RANDOM: + { + std::list::const_iterator itr = targetList.begin(); + if (position) + std::advance(itr, urand(0, position)); + else + std::advance(itr, urand(0, targetList.size() - 1)); + Eluna::Push(L, *itr); + } + break; + default: + luaL_argerror(L, 2, "SelectAggroTarget expected"); + break; } return 1; @@ -740,7 +740,7 @@ namespace LuaCreature lua_newtable(L); int tbl = lua_gettop(L); uint32 i = 0; - + #ifdef MANGOS ThreatList const& threatlist = creature->GetThreatManager().getThreatList(); #else diff --git a/ElunaBinding.h b/ElunaBinding.h index d9a28fb..bb5b271 100644 --- a/ElunaBinding.h +++ b/ElunaBinding.h @@ -23,7 +23,7 @@ public: Eluna& E; const char* groupName; - ElunaBind(const char* bindGroupName, Eluna& _E): E(_E), groupName(bindGroupName) + ElunaBind(const char* bindGroupName, Eluna& _E) : E(_E), groupName(bindGroupName) { } @@ -33,7 +33,7 @@ public: } // unregisters all registered functions and clears all registered events from the bindings - virtual void Clear() {}; + virtual void Clear() { }; }; template @@ -43,7 +43,7 @@ public: typedef std::vector ElunaBindingMap; typedef std::map ElunaEntryMap; - EventBind(const char* bindGroupName, Eluna& _E): ElunaBind(bindGroupName, _E) + EventBind(const char* bindGroupName, Eluna& _E) : ElunaBind(bindGroupName, _E) { } @@ -96,7 +96,7 @@ public: typedef std::map ElunaBindingMap; typedef UNORDERED_MAP ElunaEntryMap; - EntryBind(const char* bindGroupName, Eluna& _E): ElunaBind(bindGroupName, _E) + EntryBind(const char* bindGroupName, Eluna& _E) : ElunaBind(bindGroupName, _E) { } diff --git a/ElunaUtility.cpp b/ElunaUtility.cpp index 57f6bf5..788b1af 100644 --- a/ElunaUtility.cpp +++ b/ElunaUtility.cpp @@ -27,7 +27,7 @@ uint32 ElunaUtil::GetTimeDiff(uint32 oldMSTime) #endif } -ElunaUtil::ObjectGUIDCheck::ObjectGUIDCheck(ObjectGuid guid): _guid(guid) +ElunaUtil::ObjectGUIDCheck::ObjectGUIDCheck(ObjectGuid guid) : _guid(guid) { } @@ -36,7 +36,7 @@ bool ElunaUtil::ObjectGUIDCheck::operator()(WorldObject* object) return object->GET_GUID() == _guid; } -ElunaUtil::ObjectDistanceOrderPred::ObjectDistanceOrderPred(WorldObject const* pRefObj, bool ascending): m_refObj(pRefObj), m_ascending(ascending) +ElunaUtil::ObjectDistanceOrderPred::ObjectDistanceOrderPred(WorldObject const* pRefObj, bool ascending) : m_refObj(pRefObj), m_ascending(ascending) { } bool ElunaUtil::ObjectDistanceOrderPred::operator()(WorldObject const* pLeft, WorldObject const* pRight) const @@ -45,7 +45,7 @@ bool ElunaUtil::ObjectDistanceOrderPred::operator()(WorldObject const* pLeft, Wo } ElunaUtil::WorldObjectInRangeCheck::WorldObjectInRangeCheck(bool nearest, WorldObject const* obj, float range, - uint16 typeMask, uint32 entry, uint32 hostile): i_nearest(nearest), + uint16 typeMask, uint32 entry, uint32 hostile) : i_nearest(nearest), i_obj(obj), i_range(range), i_typeMask(typeMask), i_entry(entry), i_hostile(hostile) { } diff --git a/ElunaUtility.h b/ElunaUtility.h index 32df7d8..82a7987 100644 --- a/ElunaUtility.h +++ b/ElunaUtility.h @@ -124,7 +124,7 @@ namespace ElunaUtil * ReadGuard lock(_lock); * or * WriteGuard lock(_lock); - * + * * The lock is automatically released at end of scope */ class RWLockable diff --git a/GlobalMethods.h b/GlobalMethods.h index d410753..a495923 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -1008,19 +1008,19 @@ namespace LuaGlobalFunctions const char* query = Eluna::CHECKVAL(L, 1); #ifdef TRINITY - ElunaQuery result = WorldDatabase.Query(query); - if (result) - Eluna::Push(L, new ElunaQuery(result)); - else - Eluna::Push(L); + ElunaQuery result = WorldDatabase.Query(query); + if (result) + Eluna::Push(L, new ElunaQuery(result)); + else + Eluna::Push(L); #else - ElunaQuery* result = WorldDatabase.QueryNamed(query); - if (result) - Eluna::Push(L, result); - else - Eluna::Push(L); + ElunaQuery* result = WorldDatabase.QueryNamed(query); + if (result) + Eluna::Push(L, result); + else + Eluna::Push(L); #endif - return 1; + return 1; } /** @@ -1046,19 +1046,19 @@ namespace LuaGlobalFunctions const char* query = Eluna::CHECKVAL(L, 1); #ifdef TRINITY - QueryResult result = CharacterDatabase.Query(query); - if (result) - Eluna::Push(L, new QueryResult(result)); - else - Eluna::Push(L); + QueryResult result = CharacterDatabase.Query(query); + if (result) + Eluna::Push(L, new QueryResult(result)); + else + Eluna::Push(L); #else - QueryNamedResult* result = CharacterDatabase.QueryNamed(query); - if (result) - Eluna::Push(L, result); - else - Eluna::Push(L); + QueryNamedResult* result = CharacterDatabase.QueryNamed(query); + if (result) + Eluna::Push(L, result); + else + Eluna::Push(L); #endif - return 1; + return 1; } /** @@ -1081,20 +1081,20 @@ namespace LuaGlobalFunctions */ int AuthDBQuery(lua_State* L) { - const char* query = Eluna::CHECKVAL(L, 1); + const char* query = Eluna::CHECKVAL(L, 1); #ifdef TRINITY - QueryResult result = LoginDatabase.Query(query); - if (result) - Eluna::Push(L, new QueryResult(result)); - else - Eluna::Push(L); + QueryResult result = LoginDatabase.Query(query); + if (result) + Eluna::Push(L, new QueryResult(result)); + else + Eluna::Push(L); #else - QueryNamedResult* result = LoginDatabase.QueryNamed(query); - if (result) - Eluna::Push(L, result); - else - Eluna::Push(L); + QueryNamedResult* result = LoginDatabase.QueryNamed(query); + if (result) + Eluna::Push(L, result); + else + Eluna::Push(L); #endif return 1; } diff --git a/HookMgr.cpp b/HookMgr.cpp index ad01c86..08dfa4c 100644 --- a/HookMgr.cpp +++ b/HookMgr.cpp @@ -28,19 +28,19 @@ struct ScriptedAI; using namespace HookMgr; /* -Call model for EventBind: - -// Begin the call if should -EVENT_BEGIN(bindmap, eventid, return returnvalue); -// push arguments -Push(L, pPlayer); -EVENT_EXECUTE(returnedargs); -FOR_RET(iter) -{ -// process returned arguments -} -ENDCALL(); -*/ + * Call model for EventBind: + * + * // Begin the call if should + * EVENT_BEGIN(bindmap, eventid, return returnvalue); + * // push arguments + * Push(L, pPlayer); + * EVENT_EXECUTE(returnedargs); + * FOR_RET(iter) + * { + * // process returned arguments + * } + * ENDCALL(); + */ // RET is a return statement #define EVENT_BEGIN(BINDMAP, EVENT, RET) \ @@ -1456,11 +1456,11 @@ struct ElunaCreatureAI : ScriptedAI #define me m_creature #endif - ElunaCreatureAI(Creature* creature): ScriptedAI(creature) + ElunaCreatureAI(Creature* creature) : ScriptedAI(creature) { JustRespawned(); } - ~ElunaCreatureAI() {} + ~ElunaCreatureAI() { } //Called at World update tick #ifndef TRINITY diff --git a/ItemMethods.h b/ItemMethods.h index 2e74e61..892ff27 100644 --- a/ItemMethods.h +++ b/ItemMethods.h @@ -137,12 +137,12 @@ namespace LuaItem } /* - int IsRefundExpired(lua_State* L, Item* item)// TODO: Implement core support - { - Eluna::Push(L, item->IsRefundExpired()); - return 1; - } - */ + * int IsRefundExpired(lua_State* L, Item* item)// TODO: Implement core support + * { + * Eluna::Push(L, item->IsRefundExpired()); + * return 1; + * } + */ /* GETTERS */ int GetItemLink(lua_State* L, Item* item) diff --git a/LuaEngine.cpp b/LuaEngine.cpp index e238a55..333154c 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -87,7 +87,7 @@ void Eluna::ReloadEluna() reload = false; } -Eluna::Eluna(): +Eluna::Eluna() : L(luaL_newstate()), eventMgr(NULL), @@ -406,14 +406,14 @@ void Eluna::Push(lua_State* L, Unit const* unit) } switch (unit->GetTypeId()) { - case TYPEID_UNIT: - Push(L, unit->ToCreature()); - break; - case TYPEID_PLAYER: - Push(L, unit->ToPlayer()); - break; - default: - ElunaTemplate::push(L, unit); + case TYPEID_UNIT: + Push(L, unit->ToCreature()); + break; + case TYPEID_PLAYER: + Push(L, unit->ToPlayer()); + break; + default: + ElunaTemplate::push(L, unit); } } void Eluna::Push(lua_State* L, WorldObject const* obj) @@ -425,20 +425,20 @@ void Eluna::Push(lua_State* L, WorldObject const* obj) } switch (obj->GetTypeId()) { - case TYPEID_UNIT: - Push(L, obj->ToCreature()); - break; - case TYPEID_PLAYER: - Push(L, obj->ToPlayer()); - break; - case TYPEID_GAMEOBJECT: - Push(L, obj->ToGameObject()); - break; - case TYPEID_CORPSE: - Push(L, obj->ToCorpse()); - break; - default: - ElunaTemplate::push(L, obj); + case TYPEID_UNIT: + Push(L, obj->ToCreature()); + break; + case TYPEID_PLAYER: + Push(L, obj->ToPlayer()); + break; + case TYPEID_GAMEOBJECT: + Push(L, obj->ToGameObject()); + break; + case TYPEID_CORPSE: + Push(L, obj->ToCorpse()); + break; + default: + ElunaTemplate::push(L, obj); } } void Eluna::Push(lua_State* L, Object const* obj) @@ -450,20 +450,20 @@ void Eluna::Push(lua_State* L, Object const* obj) } switch (obj->GetTypeId()) { - case TYPEID_UNIT: - Push(L, obj->ToCreature()); - break; - case TYPEID_PLAYER: - Push(L, obj->ToPlayer()); - break; - case TYPEID_GAMEOBJECT: - Push(L, obj->ToGameObject()); - break; - case TYPEID_CORPSE: - Push(L, obj->ToCorpse()); - break; - default: - ElunaTemplate::push(L, obj); + case TYPEID_UNIT: + Push(L, obj->ToCreature()); + break; + case TYPEID_PLAYER: + Push(L, obj->ToPlayer()); + break; + case TYPEID_GAMEOBJECT: + Push(L, obj->ToGameObject()); + break; + case TYPEID_CORPSE: + Push(L, obj->ToCorpse()); + break; + default: + ElunaTemplate::push(L, obj); } } @@ -579,16 +579,17 @@ template<> uint64 Eluna::CHECKVAL(lua_State* L, int narg) {\ if (!O || !O->F())\ {\ - if (E)\ - {\ - std::string errmsg(ElunaTemplate::tname);\ - errmsg += " expected";\ - luaL_argerror(L, narg, errmsg.c_str());\ - }\ - return NULL;\ + if (E)\ + {\ + std::string errmsg(ElunaTemplate::tname);\ + errmsg += " expected";\ + luaL_argerror(L, narg, errmsg.c_str());\ + }\ + return NULL;\ }\ return O->F();\ } + template<> Unit* Eluna::CHECKOBJ(lua_State* L, int narg, bool error) { WorldObject* obj = CHECKOBJ(L, narg, false); @@ -621,166 +622,166 @@ void Eluna::Register(uint8 regtype, uint32 id, uint32 evt, int functionRef) { switch (regtype) { - case HookMgr::REGTYPE_SERVER: - if (evt < HookMgr::SERVER_EVENT_COUNT) - { - ServerEventBindings->Insert(evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_PLAYER: - if (evt < HookMgr::PLAYER_EVENT_COUNT) - { - PlayerEventBindings->Insert(evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_GUILD: - if (evt < HookMgr::GUILD_EVENT_COUNT) - { - GuildEventBindings->Insert(evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_GROUP: - if (evt < HookMgr::GROUP_EVENT_COUNT) - { - GroupEventBindings->Insert(evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_VEHICLE: - if (evt < HookMgr::VEHICLE_EVENT_COUNT) - { - VehicleEventBindings->Insert(evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_BG: - if (evt < HookMgr::BG_EVENT_COUNT) - { - BGEventBindings->Insert(evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_PACKET: - if (evt < HookMgr::PACKET_EVENT_COUNT) - { - if (id >= NUM_MSG_TYPES) + case HookMgr::REGTYPE_SERVER: + if (evt < HookMgr::SERVER_EVENT_COUNT) { - luaL_unref(L, LUA_REGISTRYINDEX, functionRef); - luaL_error(L, "Couldn't find a creature with (ID: %d)!", id); + ServerEventBindings->Insert(evt, functionRef); return; } + break; - PacketEventBindings->Insert(id, evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_CREATURE: - if (evt < HookMgr::CREATURE_EVENT_COUNT) - { - if (!eObjectMgr->GetCreatureTemplate(id)) + case HookMgr::REGTYPE_PLAYER: + if (evt < HookMgr::PLAYER_EVENT_COUNT) { - luaL_unref(L, LUA_REGISTRYINDEX, functionRef); - luaL_error(L, "Couldn't find a creature with (ID: %d)!", id); + PlayerEventBindings->Insert(evt, functionRef); return; } + break; - CreatureEventBindings->Insert(id, evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_CREATURE_GOSSIP: - if (evt < HookMgr::GOSSIP_EVENT_COUNT) - { - if (!eObjectMgr->GetCreatureTemplate(id)) + case HookMgr::REGTYPE_GUILD: + if (evt < HookMgr::GUILD_EVENT_COUNT) { - luaL_unref(L, LUA_REGISTRYINDEX, functionRef); - luaL_error(L, "Couldn't find a creature with (ID: %d)!", id); + GuildEventBindings->Insert(evt, functionRef); return; } + break; - CreatureGossipBindings->Insert(id, evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_GAMEOBJECT: - if (evt < HookMgr::GAMEOBJECT_EVENT_COUNT) - { - if (!eObjectMgr->GetGameObjectTemplate(id)) + case HookMgr::REGTYPE_GROUP: + if (evt < HookMgr::GROUP_EVENT_COUNT) { - luaL_unref(L, LUA_REGISTRYINDEX, functionRef); - luaL_error(L, "Couldn't find a gameobject with (ID: %d)!", id); + GroupEventBindings->Insert(evt, functionRef); return; } + break; - GameObjectEventBindings->Insert(id, evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_GAMEOBJECT_GOSSIP: - if (evt < HookMgr::GOSSIP_EVENT_COUNT) - { - if (!eObjectMgr->GetGameObjectTemplate(id)) + case HookMgr::REGTYPE_VEHICLE: + if (evt < HookMgr::VEHICLE_EVENT_COUNT) { - luaL_unref(L, LUA_REGISTRYINDEX, functionRef); - luaL_error(L, "Couldn't find a gameobject with (ID: %d)!", id); + VehicleEventBindings->Insert(evt, functionRef); return; } + break; - GameObjectGossipBindings->Insert(id, evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_ITEM: - if (evt < HookMgr::ITEM_EVENT_COUNT) - { - if (!eObjectMgr->GetItemTemplate(id)) + case HookMgr::REGTYPE_BG: + if (evt < HookMgr::BG_EVENT_COUNT) { - luaL_unref(L, LUA_REGISTRYINDEX, functionRef); - luaL_error(L, "Couldn't find a item with (ID: %d)!", id); + BGEventBindings->Insert(evt, functionRef); return; } + break; - ItemEventBindings->Insert(id, evt, functionRef); - return; - } - break; - - case HookMgr::REGTYPE_ITEM_GOSSIP: - if (evt < HookMgr::GOSSIP_EVENT_COUNT) - { - if (!eObjectMgr->GetItemTemplate(id)) + case HookMgr::REGTYPE_PACKET: + if (evt < HookMgr::PACKET_EVENT_COUNT) { - luaL_unref(L, LUA_REGISTRYINDEX, functionRef); - luaL_error(L, "Couldn't find a item with (ID: %d)!", id); + if (id >= NUM_MSG_TYPES) + { + luaL_unref(L, LUA_REGISTRYINDEX, functionRef); + luaL_error(L, "Couldn't find a creature with (ID: %d)!", id); + return; + } + + PacketEventBindings->Insert(id, evt, functionRef); return; } + break; - ItemGossipBindings->Insert(id, evt, functionRef); - return; - } - break; + case HookMgr::REGTYPE_CREATURE: + if (evt < HookMgr::CREATURE_EVENT_COUNT) + { + if (!eObjectMgr->GetCreatureTemplate(id)) + { + luaL_unref(L, LUA_REGISTRYINDEX, functionRef); + luaL_error(L, "Couldn't find a creature with (ID: %d)!", id); + return; + } - case HookMgr::REGTYPE_PLAYER_GOSSIP: - if (evt < HookMgr::GOSSIP_EVENT_COUNT) - { - playerGossipBindings->Insert(id, evt, functionRef); - return; - } - break; + CreatureEventBindings->Insert(id, evt, functionRef); + return; + } + break; + + case HookMgr::REGTYPE_CREATURE_GOSSIP: + if (evt < HookMgr::GOSSIP_EVENT_COUNT) + { + if (!eObjectMgr->GetCreatureTemplate(id)) + { + luaL_unref(L, LUA_REGISTRYINDEX, functionRef); + luaL_error(L, "Couldn't find a creature with (ID: %d)!", id); + return; + } + + CreatureGossipBindings->Insert(id, evt, functionRef); + return; + } + break; + + case HookMgr::REGTYPE_GAMEOBJECT: + if (evt < HookMgr::GAMEOBJECT_EVENT_COUNT) + { + if (!eObjectMgr->GetGameObjectTemplate(id)) + { + luaL_unref(L, LUA_REGISTRYINDEX, functionRef); + luaL_error(L, "Couldn't find a gameobject with (ID: %d)!", id); + return; + } + + GameObjectEventBindings->Insert(id, evt, functionRef); + return; + } + break; + + case HookMgr::REGTYPE_GAMEOBJECT_GOSSIP: + if (evt < HookMgr::GOSSIP_EVENT_COUNT) + { + if (!eObjectMgr->GetGameObjectTemplate(id)) + { + luaL_unref(L, LUA_REGISTRYINDEX, functionRef); + luaL_error(L, "Couldn't find a gameobject with (ID: %d)!", id); + return; + } + + GameObjectGossipBindings->Insert(id, evt, functionRef); + return; + } + break; + + case HookMgr::REGTYPE_ITEM: + if (evt < HookMgr::ITEM_EVENT_COUNT) + { + if (!eObjectMgr->GetItemTemplate(id)) + { + luaL_unref(L, LUA_REGISTRYINDEX, functionRef); + luaL_error(L, "Couldn't find a item with (ID: %d)!", id); + return; + } + + ItemEventBindings->Insert(id, evt, functionRef); + return; + } + break; + + case HookMgr::REGTYPE_ITEM_GOSSIP: + if (evt < HookMgr::GOSSIP_EVENT_COUNT) + { + if (!eObjectMgr->GetItemTemplate(id)) + { + luaL_unref(L, LUA_REGISTRYINDEX, functionRef); + luaL_error(L, "Couldn't find a item with (ID: %d)!", id); + return; + } + + ItemGossipBindings->Insert(id, evt, functionRef); + return; + } + break; + + case HookMgr::REGTYPE_PLAYER_GOSSIP: + if (evt < HookMgr::GOSSIP_EVENT_COUNT) + { + playerGossipBindings->Insert(id, evt, functionRef); + return; + } + break; } luaL_unref(L, LUA_REGISTRYINDEX, functionRef); luaL_error(L, "Unknown event type (regtype %d, id %d, event %d)", regtype, id, evt); diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 7257c0e..4f11036 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -797,7 +797,7 @@ ElunaRegister CreatureMethods[] = { "Respawn", &LuaCreature::Respawn }, { "AttackStart", &LuaCreature::AttackStart }, #ifdef TRINITY - {"AddLootMode", &LuaCreature::AddLootMode}, + { "AddLootMode", &LuaCreature::AddLootMode }, { "ResetLootMode", &LuaCreature::ResetLootMode }, { "RemoveLootMode", &LuaCreature::RemoveLootMode }, #endif diff --git a/MapMethods.h b/MapMethods.h index 6a2a3b9..7b83976 100644 --- a/MapMethods.h +++ b/MapMethods.h @@ -9,7 +9,7 @@ namespace LuaMap { - + #ifndef CLASSIC /** * Returns 'true' if the [Map] is an arena, false otherwise @@ -202,29 +202,29 @@ namespace LuaMap #else switch (GUID_HIPART(guid)) { - case HIGHGUID_PLAYER: - Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Player*)NULL)); - break; - case HIGHGUID_TRANSPORT: - case HIGHGUID_MO_TRANSPORT: - case HIGHGUID_GAMEOBJECT: - Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (GameObject*)NULL)); - break; - case HIGHGUID_VEHICLE: - case HIGHGUID_UNIT: - Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Creature*)NULL)); - break; - case HIGHGUID_PET: - Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Pet*)NULL)); - break; - case HIGHGUID_DYNAMICOBJECT: - Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (DynamicObject*)NULL)); - break; - case HIGHGUID_CORPSE: - Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Corpse*)NULL)); - break; - default: - break; + case HIGHGUID_PLAYER: + Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Player*)NULL)); + break; + case HIGHGUID_TRANSPORT: + case HIGHGUID_MO_TRANSPORT: + case HIGHGUID_GAMEOBJECT: + Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (GameObject*)NULL)); + break; + case HIGHGUID_VEHICLE: + case HIGHGUID_UNIT: + Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Creature*)NULL)); + break; + case HIGHGUID_PET: + Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Pet*)NULL)); + break; + case HIGHGUID_DYNAMICOBJECT: + Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (DynamicObject*)NULL)); + break; + case HIGHGUID_CORPSE: + Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Corpse*)NULL)); + break; + default: + break; } #endif return 1; diff --git a/PlayerMethods.h b/PlayerMethods.h index b899615..3b8cd1b 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -1176,14 +1176,14 @@ namespace LuaPlayer Gender gender; switch (_gender) { - case 0: - gender = GENDER_MALE; - break; - case 1: - gender = GENDER_FEMALE; - break; - default: - return luaL_argerror(L, 2, "valid Gender expected"); + case 0: + gender = GENDER_MALE; + break; + case 1: + gender = GENDER_FEMALE; + break; + default: + return luaL_argerror(L, 2, "valid Gender expected"); } player->SetByteValue(UNIT_FIELD_BYTES_0, 2, gender); diff --git a/QuestMethods.h b/QuestMethods.h index 579ae1f..8c04c3c 100644 --- a/QuestMethods.h +++ b/QuestMethods.h @@ -38,7 +38,7 @@ namespace LuaQuest * QUEST_FLAGS_DISPLAY_ITEM_IN_TRACKER = 0x20000, // Displays usable item in quest tracker * QUEST_FLAGS_OBJ_TEXT = 0x40000, // use Objective text as Complete text * QUEST_FLAGS_AUTO_ACCEPT = 0x80000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future. - * + * * // ... 4.x added flags up to 0x80000000 - all unknown for now * }; * @@ -164,7 +164,7 @@ namespace LuaQuest /** * Returns the [Quest]'s type. - * + * * TODO: Document types available. * * @return uint32 type diff --git a/WeatherMethods.h b/WeatherMethods.h index f29ecd8..0172f8f 100644 --- a/WeatherMethods.h +++ b/WeatherMethods.h @@ -62,7 +62,7 @@ namespace LuaWeather /** * Regenerates the [Weather], causing it to change based on the below statistics. - * + * * * 30% chance of no change * * 30% chance of [Weather] getting better (if not fine) or changing [Weather] type * * 30% chance of [Weather] getting worse (if not fine)