feat(CI/Codestyle): added codestyle check (#3668)

This commit is contained in:
Kargatum
2021-01-09 17:59:50 +07:00
committed by GitHub
parent 57aa46244d
commit ea93a5c1a1
400 changed files with 238 additions and 748 deletions

15
.github/workflows/codestyle.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: check-codestyle
on:
push:
pull_request:
jobs:
check-codestyle:
strategy:
fail-fast: false
runs-on: ubuntu-20.04
name: check codestyle
steps:
- uses: actions/checkout@v2
- name: Check core codestyle
run: source ./apps/ci/ci-codestyle.sh

23
apps/ci/ci-codestyle.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
set -e
echo "Codestyle check script:"
echo
declare -A singleLineRegexChecks=(
["[[:blank:]]$"]="Remove whitespace at the end of the lines above"
["\t"]="Replace tabs with 4 spaces in the lines above"
)
for check in ${!singleLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"
if grep -P -r -I -n ${check} src; then
echo
echo "${singleLineRegexChecks[$check]}"
exit 1
fi
done
echo
echo "Everything looks good"

View File

@@ -1,4 +1,4 @@
# Copyright (C) # Copyright (C)
# #
# This file is free software; as a special exception the author gives # This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without # unlimited permission to copy and/or distribute it, with or without

View File

@@ -29,7 +29,6 @@ MACRO(AC_ADD_SCRIPT_LOADER script_dec include)
CU_ADD_GLOBAL("AC_ADD_SCRIPTS_LIST" "Add${script_dec}Scripts()\;") CU_ADD_GLOBAL("AC_ADD_SCRIPTS_LIST" "Add${script_dec}Scripts()\;")
endif() endif()
if (NOT ${include} STREQUAL "") if (NOT ${include} STREQUAL "")
CU_GET_GLOBAL("AC_ADD_SCRIPTS_INCLUDE") CU_GET_GLOBAL("AC_ADD_SCRIPTS_INCLUDE")
if (NOT ";${AC_ADD_SCRIPTS_INCLUDE};" MATCHES ";${include};") if (NOT ";${AC_ADD_SCRIPTS_INCLUDE};" MATCHES ";${include};")

View File

@@ -96,7 +96,7 @@ if(NOT WITH_WARNINGS)
/wd4267 /wd4267
/wd4619 /wd4619
# /wd4512 # /wd4512
) )
message(STATUS "MSVC: Disabled generic compiletime warnings") message(STATUS "MSVC: Disabled generic compiletime warnings")
endif() endif()
endif() endif()

View File

@@ -1,4 +1,4 @@
# Copyright (C) # Copyright (C)
# #
# This file is free software; as a special exception the author gives # This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without # unlimited permission to copy and/or distribute it, with or without

View File

@@ -58,7 +58,6 @@
# Redistribution and use is allowed according to the terms of the BSD license. # Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
MACRO(NORMALIZE_VERSION _requested_version _normalized_version) MACRO(NORMALIZE_VERSION _requested_version _normalized_version)
STRING(REGEX MATCH "[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" _threePartMatch "${_requested_version}") STRING(REGEX MATCH "[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" _threePartMatch "${_requested_version}")
if (_threePartMatch) if (_threePartMatch)

View File

@@ -1,6 +1,6 @@
# #
# Find the MySQL client includes and library # Find the MySQL client includes and library
# #
# This module defines # This module defines
# MYSQL_INCLUDE_DIR, where to find mysql.h # MYSQL_INCLUDE_DIR, where to find mysql.h
@@ -160,7 +160,7 @@ find_path(MYSQL_INCLUDE_DIR
if( UNIX ) if( UNIX )
foreach(LIB ${MYSQL_ADD_LIBRARIES}) foreach(LIB ${MYSQL_ADD_LIBRARIES})
find_library( MYSQL_LIBRARY find_library( MYSQL_LIBRARY
NAMES NAMES
mysql libmysql ${LIB} mysql libmysql ${LIB}
PATHS PATHS
@@ -176,7 +176,7 @@ if( UNIX )
endif( UNIX ) endif( UNIX )
if( WIN32 ) if( WIN32 )
find_library( MYSQL_LIBRARY find_library( MYSQL_LIBRARY
NAMES NAMES
libmysql libmysql
PATHS PATHS

View File

@@ -182,7 +182,7 @@ ENDIF(WIN32 AND NOT CYGWIN)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenSSL DEFAULT_MSG find_package_handle_standard_args(OpenSSL DEFAULT_MSG
OPENSSL_LIBRARIES OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR OPENSSL_INCLUDE_DIR
) )

View File

@@ -2,4 +2,3 @@
if( PREFIX ) if( PREFIX )
set(CMAKE_INSTALL_PREFIX "${PREFIX}") set(CMAKE_INSTALL_PREFIX "${PREFIX}")
endif() endif()

View File

@@ -145,4 +145,3 @@ else()
endif() endif()
message("") message("")

View File

@@ -364,7 +364,7 @@ protected:
int numBVH2{0}; int numBVH2{0};
public: public:
BuildStats() BuildStats()
{ {
for (int & i : numLeavesN) i = 0; for (int & i : numLeavesN) i = 0;
} }

View File

@@ -12,7 +12,6 @@
#include "G3D/Set.h" #include "G3D/Set.h"
#include "BoundingIntervalHierarchy.h" #include "BoundingIntervalHierarchy.h"
template<class T, class BoundsFunc = BoundsTrait<T>> template<class T, class BoundsFunc = BoundsTrait<T>>
class BIHWrap class BIHWrap
{ {

View File

@@ -38,4 +38,3 @@ namespace MMAP
} }
#endif #endif

View File

@@ -50,7 +50,6 @@ namespace MMAP
MMapTileSet mmapLoadedTiles; // maps [map grid coords] to [dtTile] MMapTileSet mmapLoadedTiles; // maps [map grid coords] to [dtTile]
}; };
typedef std::unordered_map<uint32, MMapData*> MMapDataSet; typedef std::unordered_map<uint32, MMapData*> MMapDataSet;
// singleton class // singleton class

View File

@@ -408,7 +408,6 @@ namespace VMAP
READ_OR_RETURN(&mogpflags, sizeof(uint32)); READ_OR_RETURN(&mogpflags, sizeof(uint32));
READ_OR_RETURN(&GroupWMOID, sizeof(uint32)); READ_OR_RETURN(&GroupWMOID, sizeof(uint32));
Vector3 vec1, vec2; Vector3 vec1, vec2;
READ_OR_RETURN(&vec1, sizeof(Vector3)); READ_OR_RETURN(&vec1, sizeof(Vector3));
@@ -482,7 +481,6 @@ namespace VMAP
return true; return true;
} }
GroupModel_Raw::~GroupModel_Raw() GroupModel_Raw::~GroupModel_Raw()
{ {
delete liquid; delete liquid;

View File

@@ -63,7 +63,6 @@ namespace VMAP
std::vector<G3D::Vector3> vertexArray; std::vector<G3D::Vector3> vertexArray;
class WmoLiquid* liquid; class WmoLiquid* liquid;
GroupModel_Raw() : liquid(nullptr) { } GroupModel_Raw() : liquid(nullptr) { }
~GroupModel_Raw(); ~GroupModel_Raw();

View File

@@ -34,7 +34,6 @@ class GameObjectModel /*, public Intersectable*/
VMAP::WorldModel* iModel; VMAP::WorldModel* iModel;
GameObject const* owner; GameObject const* owner;
GameObjectModel() : iModel(nullptr), owner(nullptr) { } GameObjectModel() : iModel(nullptr), owner(nullptr) { }
bool initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info); bool initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info);

View File

@@ -1,7 +1,6 @@
#ifndef _REGULAR_GRID_H #ifndef _REGULAR_GRID_H
#define _REGULAR_GRID_H #define _REGULAR_GRID_H
#include <G3D/Ray.h> #include <G3D/Ray.h>
#include <G3D/Table.h> #include <G3D/Table.h>
#include <G3D/BoundsTrait.h> #include <G3D/BoundsTrait.h>
@@ -143,7 +142,6 @@ public:
bool isValid() const { return x >= 0 && x < CELL_NUMBER && y >= 0 && y < CELL_NUMBER;} bool isValid() const { return x >= 0 && x < CELL_NUMBER && y >= 0 && y < CELL_NUMBER;}
}; };
Node& getGridFor(float fx, float fy) Node& getGridFor(float fx, float fy)
{ {
Cell c = Cell::ComputeCell(fx, fy); Cell c = Cell::ComputeCell(fx, fy);

View File

@@ -35,4 +35,3 @@ void CleanStringForMysqlQuery(std::string& str)
while ((n = str.find('"')) != str.npos) str.erase(n, 1); while ((n = str.find('"')) != str.npos) str.erase(n, 1);
while ((n = str.find('\'')) != str.npos) str.erase(n, 1); while ((n = str.find('\'')) != str.npos) str.erase(n, 1);
} }

View File

@@ -58,4 +58,3 @@ void AuthCrypt::EncryptSend(uint8* data, size_t len)
_serverEncrypt.UpdateData(len, data); _serverEncrypt.UpdateData(len, data);
} }

View File

@@ -4,7 +4,6 @@
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*/ */
#include "Cryptography/BigNumber.h" #include "Cryptography/BigNumber.h"
#include <openssl/bn.h> #include <openssl/bn.h>
#include <openssl/crypto.h> #include <openssl/crypto.h>
@@ -186,4 +185,3 @@ char* BigNumber::AsDecStr() const
{ {
return BN_bn2dec(_bn); return BN_bn2dec(_bn);
} }

View File

@@ -88,4 +88,3 @@ private:
}; };
#endif #endif

View File

@@ -32,4 +32,3 @@ private:
uint8 m_digest[SHA_DIGEST_LENGTH]; uint8 m_digest[SHA_DIGEST_LENGTH];
}; };
#endif #endif

View File

@@ -53,4 +53,3 @@ void SHA1Hash::Finalize(void)
{ {
SHA1_Final(mDigest, &mC); SHA1_Final(mDigest, &mC);
} }

View File

@@ -35,4 +35,3 @@ private:
uint8 mDigest[SHA_DIGEST_LENGTH]; uint8 mDigest[SHA_DIGEST_LENGTH];
}; };
#endif #endif

View File

@@ -31,4 +31,3 @@ extern CharacterDatabaseWorkerPool CharacterDatabase;
extern LoginDatabaseWorkerPool LoginDatabase; extern LoginDatabaseWorkerPool LoginDatabase;
#endif #endif

View File

@@ -410,4 +410,3 @@ private:
}; };
#endif #endif

View File

@@ -451,7 +451,6 @@ PreparedStatementTask::PreparedStatementTask(PreparedStatement* stmt, PreparedQu
{ {
} }
PreparedStatementTask::~PreparedStatementTask() PreparedStatementTask::~PreparedStatementTask()
{ {
delete m_stmt; delete m_stmt;

View File

@@ -99,4 +99,3 @@ private:
typedef std::shared_ptr<PreparedResultSet> PreparedQueryResult; typedef std::shared_ptr<PreparedResultSet> PreparedQueryResult;
#endif #endif

View File

@@ -70,7 +70,6 @@ bool WheatyExceptionReport::alreadyCrashed;
std::mutex WheatyExceptionReport::alreadyCrashedLock; std::mutex WheatyExceptionReport::alreadyCrashedLock;
WheatyExceptionReport::pRtlGetVersion WheatyExceptionReport::RtlGetVersion; WheatyExceptionReport::pRtlGetVersion WheatyExceptionReport::RtlGetVersion;
// Declare global instance of class // Declare global instance of class
WheatyExceptionReport g_WheatyExceptionReport; WheatyExceptionReport g_WheatyExceptionReport;
@@ -1230,7 +1229,6 @@ void WheatyExceptionReport::DumpTypeIndex(
dataKind == DataIsStaticMember) dataKind == DataIsStaticMember)
continue; continue;
symbolDetails.top().HasChildren = true; symbolDetails.top().HasChildren = true;
if (!logChildren) if (!logChildren)
{ {

View File

@@ -75,7 +75,7 @@ private:
LinkedListElement iLast; LinkedListElement iLast;
uint32 iSize{0}; uint32 iSize{0};
public: public:
LinkedListHead() LinkedListHead()
{ {
// create empty list // create empty list

View File

@@ -41,4 +41,3 @@ public:
//===================================================== //=====================================================
#endif #endif

View File

@@ -109,4 +109,3 @@ private:
ContainerMapList<OBJECT_TYPES> i_elements; ContainerMapList<OBJECT_TYPES> i_elements;
}; };
#endif #endif

View File

@@ -98,4 +98,3 @@ namespace acore
//} //}
} }
#endif #endif

View File

@@ -153,4 +153,3 @@ namespace acore
} }
#endif #endif

View File

@@ -96,4 +96,3 @@ private:
VISITOR& i_visitor; VISITOR& i_visitor;
}; };
#endif #endif

View File

@@ -29,4 +29,3 @@ struct TypeList
#define TYPELIST_4(T1, T2, T3, T4) TypeList<T1, TYPELIST_3(T2, T3, T4) > #define TYPELIST_4(T1, T2, T3, T4) TypeList<T1, TYPELIST_3(T2, T3, T4) >
#define TYPELIST_5(T1, T2, T3, T4, T5) TypeList<T1, TYPELIST_4(T2, T3, T4, T5) > #define TYPELIST_5(T1, T2, T3, T4, T5) TypeList<T1, TYPELIST_4(T2, T3, T4, T5) >
#endif #endif

View File

@@ -127,5 +127,4 @@ public:
virtual bool GetSQLDriverQueryLogging() const = 0; virtual bool GetSQLDriverQueryLogging() const = 0;
}; };
#endif //AZEROTHCORE_ILOG_H #endif //AZEROTHCORE_ILOG_H

View File

@@ -64,7 +64,6 @@ Log::~Log()
miscLogFile = NULL; miscLogFile = NULL;
} }
std::unique_ptr<ILog>& getLogInstance() std::unique_ptr<ILog>& getLogInstance()
{ {
static std::unique_ptr<ILog> instance = std::make_unique<Log>(); static std::unique_ptr<ILog> instance = std::make_unique<Log>();

View File

@@ -118,4 +118,3 @@ std::unique_ptr<ILog>& getLogInstance();
#define sLog getLogInstance() #define sLog getLogInstance()
#endif #endif

View File

@@ -53,7 +53,7 @@ public:
const static size_t DEFAULT_SIZE = 0x1000; const static size_t DEFAULT_SIZE = 0x1000;
// constructor // constructor
ByteBuffer() ByteBuffer()
{ {
_storage.reserve(DEFAULT_SIZE); _storage.reserve(DEFAULT_SIZE);
} }

View File

@@ -14,7 +14,7 @@ class WorldPacket : public ByteBuffer
{ {
public: public:
// just container for later use // just container for later use
WorldPacket() : ByteBuffer(0) WorldPacket() : ByteBuffer(0)
{ {
} }
explicit WorldPacket(uint16 opcode, size_t res = 200) : ByteBuffer(res), m_opcode(opcode) { } explicit WorldPacket(uint16 opcode, size_t res = 200) : ByteBuffer(res), m_opcode(opcode) { }

View File

@@ -31,7 +31,7 @@ namespace ACE_Based
//! Create a LockedQueue. //! Create a LockedQueue.
LockedQueue() LockedQueue()
{ {
} }

View File

@@ -117,7 +117,6 @@ void Thread::setPriority(Priority priority)
break; break;
} }
// remove this ASSERT in case you don't want to know is thread priority change was successful or not // remove this ASSERT in case you don't want to know is thread priority change was successful or not
ASSERT(_ok); ASSERT(_ok);
} }

View File

@@ -53,4 +53,3 @@ inline void EndianConvertReverse(uint8&) { }
inline void EndianConvertReverse( int8&) { } inline void EndianConvertReverse( int8&) { }
#endif #endif

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2 * Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
*/ */
#ifndef ACORE_OPTIONAL_H #ifndef ACORE_OPTIONAL_H

View File

@@ -249,4 +249,3 @@ bool WinServiceRun()
return true; return true;
} }
#endif #endif

View File

@@ -14,4 +14,3 @@ bool WinServiceRun();
#endif // _WIN32_SERVICE_ #endif // _WIN32_SERVICE_
#endif // _WIN32 #endif // _WIN32

View File

@@ -53,7 +53,7 @@ struct IntervalTimer
public: public:
IntervalTimer() IntervalTimer()
{ {
} }

View File

@@ -113,7 +113,7 @@ extern int main(int argc, char** argv)
sLog->outString(" ╚██████╗╚██████╔╝██║ ██║███████╗"); sLog->outString(" ╚██████╗╚██████╔╝██║ ██║███████╗");
sLog->outString(" ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝\n"); sLog->outString(" ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝\n");
sLog->outString(" AzerothCore 3.3.5a - www.azerothcore.org\n"); sLog->outString(" AzerothCore 3.3.5a - www.azerothcore.org\n");
sLog->outString("Using configuration file %s.", configFile); sLog->outString("Using configuration file %s.", configFile);

View File

@@ -580,7 +580,6 @@ bool AuthSocket::_HandleLogonChallenge()
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
_localizationName[i] = ch->country[4 - i - 1]; _localizationName[i] = ch->country[4 - i - 1];
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug( LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName) ); sLog->outDebug( LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName) );
#endif #endif

View File

@@ -242,7 +242,6 @@ WrongPass.BanType = 0
WrongPass.Logging = 0 WrongPass.Logging = 0
# #
################################################################################################### ###################################################################################################

View File

@@ -61,7 +61,6 @@ public:
void AttackStart(Unit* who) override; void AttackStart(Unit* who) override;
void UpdateAI(uint32 diff) override; void UpdateAI(uint32 diff) override;
static int Permissible(Creature const* /*creature*/) { return PERMIT_BASE_NO; } static int Permissible(Creature const* /*creature*/) { return PERMIT_BASE_NO; }
protected: protected:

View File

@@ -74,4 +74,3 @@ public:
}; };
#endif #endif

View File

@@ -47,4 +47,3 @@ protected:
}; };
#endif #endif

View File

@@ -296,7 +296,6 @@ bool SpellTargetSelector::operator()(Unit const* target) const
float max_range = _caster->GetSpellMaxRangeForTarget(target, _spellInfo); float max_range = _caster->GetSpellMaxRangeForTarget(target, _spellInfo);
float min_range = _caster->GetSpellMinRangeForTarget(target, _spellInfo); float min_range = _caster->GetSpellMinRangeForTarget(target, _spellInfo);
if (target && target != _caster) if (target && target != _caster)
{ {
if (range_type == SPELL_RANGE_MELEE) if (range_type == SPELL_RANGE_MELEE)

View File

@@ -111,7 +111,6 @@ struct PowerUsersSelector : public acore::unary_function<Unit*, bool>
float const _dist; float const _dist;
bool const _playerOnly; bool const _playerOnly;
PowerUsersSelector(Unit const* unit, Powers power, float dist, bool playerOnly) : _me(unit), _power(power), _dist(dist), _playerOnly(playerOnly) { } PowerUsersSelector(Unit const* unit, Powers power, float dist, bool playerOnly) : _me(unit), _power(power), _dist(dist), _playerOnly(playerOnly) { }
bool operator()(Unit const* target) const bool operator()(Unit const* target) const

View File

@@ -55,4 +55,3 @@ struct AISpellInfoType
AISpellInfoType* GetAISpellInfo(uint32 i); AISpellInfoType* GetAISpellInfo(uint32 i);
#endif #endif

View File

@@ -44,4 +44,3 @@ namespace AIRegistry
(new MovementGeneratorFactory<WaypointMovementGenerator<Creature> >(WAYPOINT_MOTION_TYPE))->RegisterSelf(); (new MovementGeneratorFactory<WaypointMovementGenerator<Creature> >(WAYPOINT_MOTION_TYPE))->RegisterSelf();
} }
} }

View File

@@ -12,4 +12,3 @@ namespace AIRegistry
void Initialize(void); void Initialize(void);
} }
#endif #endif

View File

@@ -139,4 +139,3 @@ namespace FactorySelector
return (ai_factory == NULL ? new NullGameObjectAI(go) : ai_factory->Create(go)); return (ai_factory == NULL ? new NullGameObjectAI(go) : ai_factory->Create(go));
} }
} }

View File

@@ -20,4 +20,3 @@ namespace FactorySelector
GameObjectAI* SelectGameObjectAI(GameObject*); GameObjectAI* SelectGameObjectAI(GameObject*);
} }
#endif #endif

View File

@@ -126,4 +126,3 @@ private:
bool HasImmuneToNPCFlags; bool HasImmuneToNPCFlags;
}; };
#endif #endif

View File

@@ -450,7 +450,6 @@ void SmartAI::UpdatePath(const uint32 diff)
} }
} }
void SmartAI::CheckConditions(const uint32 diff) void SmartAI::CheckConditions(const uint32 diff)
{ {
Vehicle* vehicle = me->GetVehicleKit(); Vehicle* vehicle = me->GetVehicleKit();

View File

@@ -121,7 +121,6 @@ namespace AccountMgr
return AOR_OK; return AOR_OK;
} }
AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword) AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword)
{ {
// Check if accounts exists // Check if accounts exists

View File

@@ -186,7 +186,7 @@ struct AchievementCriteriaData
}; };
uint32 ScriptId; uint32 ScriptId;
AchievementCriteriaData() AchievementCriteriaData()
{ {
raw.value1 = 0; raw.value1 = 0;
raw.value2 = 0; raw.value2 = 0;

View File

@@ -56,4 +56,3 @@ namespace AddonMgr
} }
#endif #endif

View File

@@ -189,7 +189,6 @@ bool Battlefield::Update(uint32 diff)
objective_changed = true; objective_changed = true;
} }
if (m_LastResurectTimer <= diff) if (m_LastResurectTimer <= diff)
{ {
for (uint8 i = 0; i < m_GraveyardList.size(); i++) for (uint8 i = 0; i < m_GraveyardList.size(); i++)

View File

@@ -49,7 +49,6 @@ enum BattlefieldTimers
BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL = 1000 BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL = 1000
}; };
const uint32 BattlefieldFactions[BG_TEAMS_COUNT] = const uint32 BattlefieldFactions[BG_TEAMS_COUNT] =
{ {
1732, // Alliance 1732, // Alliance

View File

@@ -96,7 +96,6 @@ bool BattlefieldWG::SetupBattlefield()
m_GraveyardList[i] = graveyard; m_GraveyardList[i] = graveyard;
} }
// Spawn workshop creatures and gameobjects // Spawn workshop creatures and gameobjects
for (uint8 i = 0; i < WG_MAX_WORKSHOP; i++) for (uint8 i = 0; i < WG_MAX_WORKSHOP; i++)
{ {
@@ -223,7 +222,6 @@ void BattlefieldWG::OnBattleStart()
else else
sLog->outError("WG: Failed to spawn titan relic."); sLog->outError("WG: Failed to spawn titan relic.");
// Update tower visibility and update faction // Update tower visibility and update faction
for (GuidSet::const_iterator itr = CanonList.begin(); itr != CanonList.end(); ++itr) for (GuidSet::const_iterator itr = CanonList.begin(); itr != CanonList.end(); ++itr)
{ {

View File

@@ -25,14 +25,12 @@ typedef std::set<WGWorkshop*> Workshop;
typedef std::set<Group*> GroupSet; typedef std::set<Group*> GroupSet;
//typedef std::set<WintergraspCapturePoint *> CapturePointSet; unused ? //typedef std::set<WintergraspCapturePoint *> CapturePointSet; unused ?
const uint32 VehNumWorldState[2] = { 3680, 3490 }; const uint32 VehNumWorldState[2] = { 3680, 3490 };
const uint32 MaxVehNumWorldState[2] = { 3681, 3491 }; const uint32 MaxVehNumWorldState[2] = { 3681, 3491 };
const uint32 ClockWorldState[2] = { 3781, 4354 }; const uint32 ClockWorldState[2] = { 3781, 4354 };
const uint32 WintergraspFaction[3] = { 1, 2, 35 }; const uint32 WintergraspFaction[3] = { 1, 2, 35 };
float const WintergraspStalkerPos[4] = { 4948.985f, 2937.789f, 550.5172f, 1.815142f }; float const WintergraspStalkerPos[4] = { 4948.985f, 2937.789f, 550.5172f, 1.815142f };
enum WintergraspSpells enum WintergraspSpells
{ {
// Wartime auras // Wartime auras

View File

@@ -191,4 +191,3 @@ protected:
ArenaTeamStats Stats; ArenaTeamStats Stats;
}; };
#endif #endif

View File

@@ -58,7 +58,6 @@ ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(const std::string& arenaTeamName) co
return nullptr; return nullptr;
} }
ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(std::string const& arenaTeamName, const uint32 type) const ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(std::string const& arenaTeamName, const uint32 type) const
{ {
std::string search = arenaTeamName; std::string search = arenaTeamName;
@@ -91,7 +90,6 @@ ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(uint64 guid) const
return nullptr; return nullptr;
} }
ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(uint64 guid, const uint32 type) const ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(uint64 guid, const uint32 type) const
{ {
for (ArenaTeamContainer::const_iterator itr = ArenaTeamStore.begin(); itr != ArenaTeamStore.end(); ++itr) for (ArenaTeamContainer::const_iterator itr = ArenaTeamStore.begin(); itr != ArenaTeamStore.end(); ++itr)

View File

@@ -714,7 +714,6 @@ uint32 Battleground::GetRealRepFactionForPlayer(uint32 factionId, Player* player
return factionId; return factionId;
} }
void Battleground::UpdateWorldState(uint32 Field, uint32 Value) void Battleground::UpdateWorldState(uint32 Field, uint32 Value)
{ {
WorldPacket data; WorldPacket data;

View File

@@ -384,7 +384,6 @@ void BattlegroundQueue::FillPlayersToBG(Battleground* bg, const int32 aliFree, c
auto Ali_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].begin(); auto Ali_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].begin();
for (; Ali_itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].end() && m_SelectionPools[TEAM_ALLIANCE].AddGroup((*Ali_itr), aliFree); ++Ali_itr); for (; Ali_itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].end() && m_SelectionPools[TEAM_ALLIANCE].AddGroup((*Ali_itr), aliFree); ++Ali_itr);
// horde: at first fill as much as possible // horde: at first fill as much as possible
auto Horde_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].begin(); auto Horde_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].begin();
for (; Horde_itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].end() && m_SelectionPools[TEAM_HORDE].AddGroup((*Horde_itr), hordeFree); ++Horde_itr); for (; Horde_itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].end() && m_SelectionPools[TEAM_HORDE].AddGroup((*Horde_itr), hordeFree); ++Horde_itr);

View File

@@ -277,4 +277,3 @@ private:
bool _teamScores500Disadvantage[BG_TEAMS_COUNT] {}; bool _teamScores500Disadvantage[BG_TEAMS_COUNT] {};
}; };
#endif #endif

View File

@@ -396,4 +396,3 @@ private:
uint32 _flagCapturedObject; uint32 _flagCapturedObject;
}; };
#endif #endif

View File

@@ -795,7 +795,6 @@ GraveyardStruct const* BattlegroundSA::GetClosestGraveyard(Player* player)
if (!closest && GraveyardStatus[BG_SA_BEACH_GY] == player->GetTeamId()) if (!closest && GraveyardStatus[BG_SA_BEACH_GY] == player->GetTeamId())
return sGraveyard->GetGraveyard(BG_SA_GYEntries[BG_SA_BEACH_GY]); return sGraveyard->GetGraveyard(BG_SA_GYEntries[BG_SA_BEACH_GY]);
return closest; return closest;
} }

View File

@@ -405,7 +405,6 @@ bool BattlegroundWS::SetupBattleground()
AddObject(BG_WS_OBJECT_DOOR_H_3, BG_OBJECT_DOOR_H_3_WS_ENTRY, 949.9523f, 1422.751f, 344.9273f, 0.0f, 0, 0, 0, 1, RESPAWN_IMMEDIATELY); AddObject(BG_WS_OBJECT_DOOR_H_3, BG_OBJECT_DOOR_H_3_WS_ENTRY, 949.9523f, 1422.751f, 344.9273f, 0.0f, 0, 0, 0, 1, RESPAWN_IMMEDIATELY);
AddObject(BG_WS_OBJECT_DOOR_H_4, BG_OBJECT_DOOR_H_4_WS_ENTRY, 950.7952f, 1459.583f, 342.1523f, 0.05235988f, 0, 0, 0.02617695f, 0.9996573f, RESPAWN_IMMEDIATELY); AddObject(BG_WS_OBJECT_DOOR_H_4, BG_OBJECT_DOOR_H_4_WS_ENTRY, 950.7952f, 1459.583f, 342.1523f, 0.05235988f, 0, 0, 0.02617695f, 0.9996573f, RESPAWN_IMMEDIATELY);
GraveyardStruct const* sg = sGraveyard->GetGraveyard(WS_GRAVEYARD_MAIN_ALLIANCE); GraveyardStruct const* sg = sGraveyard->GetGraveyard(WS_GRAVEYARD_MAIN_ALLIANCE);
AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE); AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE);

View File

@@ -127,7 +127,6 @@ enum BG_WS_CreatureTypes
BG_CREATURES_MAX_WS = 2 BG_CREATURES_MAX_WS = 2
}; };
enum BG_WS_Objectives enum BG_WS_Objectives
{ {
WS_OBJECTIVE_CAPTURE_FLAG = 42, WS_OBJECTIVE_CAPTURE_FLAG = 42,

View File

@@ -333,4 +333,3 @@ private:
PlayersWatchingContainer playersWatchingStore; PlayersWatchingContainer playersWatchingStore;
}; };
#endif #endif

View File

@@ -124,7 +124,6 @@ Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pk
return i->second; return i->second;
} }
uint32 ChannelMgr::_channelIdMax = 0; uint32 ChannelMgr::_channelIdMax = 0;
ChannelMgr::ChannelRightsMap ChannelMgr::channels_rights; ChannelMgr::ChannelRightsMap ChannelMgr::channels_rights;
ChannelRights ChannelMgr::channelRightsEmpty; ChannelRights ChannelMgr::channelRightsEmpty;

View File

@@ -161,5 +161,4 @@ private:
std::istringstream _iss; std::istringstream _iss;
}; };
#endif #endif

View File

@@ -62,4 +62,3 @@ public:
}; };
//================================================= //=================================================
#endif #endif

View File

@@ -122,4 +122,3 @@ public:
//============================================================== //==============================================================
#endif #endif

View File

@@ -464,8 +464,6 @@ void LoadDBCStores(const std::string& dataPath)
if (TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i)) if (TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i))
sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID, entry->price); sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID, entry->price);
// Calculate path nodes count // Calculate path nodes count
uint32 pathCount = sTaxiPathStore.GetNumRows(); uint32 pathCount = sTaxiPathStore.GetNumRows();
std::vector<uint32> pathLength; std::vector<uint32> pathLength;

View File

@@ -95,4 +95,3 @@ namespace lfg
} }
} // namespace lfg } // namespace lfg

View File

@@ -188,7 +188,6 @@ namespace lfg
guid[2] = guid[1]; guid[2] = guid[1];
} }
guid[1] = guid[0]; guid[1] = guid[0];
guid[0] = g; guid[0] = g;
@@ -479,7 +478,6 @@ namespace lfg
std::string GetRolesString(uint8 roles); std::string GetRolesString(uint8 roles);
std::string GetStateString(LfgState state); std::string GetStateString(LfgState state);
} // namespace lfg } // namespace lfg
#endif #endif

View File

@@ -424,7 +424,6 @@ namespace lfg
lockData = LFG_LOCKSTATUS_MISSING_ITEM; lockData = LFG_LOCKSTATUS_MISSING_ITEM;
} }
sScriptMgr->OnInitializeLockedDungeons(player, level, lockData); sScriptMgr->OnInitializeLockedDungeons(player, level, lockData);
/* TODO VoA closed if WG is not under team control (LFG_LOCKSTATUS_RAID_LOCKED) /* TODO VoA closed if WG is not under team control (LFG_LOCKSTATUS_RAID_LOCKED)

View File

@@ -615,7 +615,6 @@ void Creature::Update(uint32 diff)
m_moveBackwardsMovementTime = MOVE_BACKWARDS_CHECK_INTERVAL; m_moveBackwardsMovementTime = MOVE_BACKWARDS_CHECK_INTERVAL;
} }
if (!IsInEvadeMode() && IsAIEnabled) if (!IsInEvadeMode() && IsAIEnabled)
{ {
// do not allow the AI to be changed during update // do not allow the AI to be changed during update
@@ -791,7 +790,6 @@ void Creature::RegenerateHealth()
addvalue = uint32(Spirit * 0.80 * HealthIncreaseRate); addvalue = uint32(Spirit * 0.80 * HealthIncreaseRate);
} }
// Apply modifiers (if any). // Apply modifiers (if any).
AuraEffectList const& ModPowerRegenPCTAuras = GetAuraEffectsByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT); AuraEffectList const& ModPowerRegenPCTAuras = GetAuraEffectsByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT);
for (AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i) for (AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
@@ -1364,7 +1362,6 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, const
else else
CreateVehicleKit(vehId, Entry); CreateVehicleKit(vehId, Entry);
if (!UpdateEntry(Entry, data)) if (!UpdateEntry(Entry, data))
return false; return false;

View File

@@ -1190,7 +1190,6 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
{ {
GameObject* ok = nullptr; GameObject* ok = nullptr;
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY())); CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p); Cell cell(p);
acore::NearestGameObjectFishingHole u_check(*this, range); acore::NearestGameObjectFishingHole u_check(*this, range);

View File

@@ -230,4 +230,3 @@ Item* Bag::GetItemByPos(uint8 slot) const
return nullptr; return nullptr;
} }

View File

@@ -59,4 +59,3 @@ inline Item* NewItemOrBag(ItemTemplate const* proto)
return (proto->InventoryType == INVTYPE_BAG) ? new Bag : new Item; return (proto->InventoryType == INVTYPE_BAG) ? new Bag : new Item;
} }
#endif #endif

View File

@@ -188,4 +188,3 @@ uint32 GenerateEnchSuffixFactor(uint32 item_id)
} }
return 0; return 0;
} }

View File

@@ -13,4 +13,3 @@ void LoadRandomEnchantmentsTable();
uint32 GetItemEnchantMod(int32 entry); uint32 GetItemEnchantMod(int32 entry);
uint32 GenerateEnchSuffixFactor(uint32 item_id); uint32 GenerateEnchSuffixFactor(uint32 item_id);
#endif #endif

View File

@@ -1845,7 +1845,6 @@ bool WorldObject::CanDetectStealthOf(WorldObject const* obj, bool checkAlert) co
if (checkAlert) if (checkAlert)
visibilityRange += (visibilityRange * 0.08f) + 1.5f; visibilityRange += (visibilityRange * 0.08f) + 1.5f;
Unit const* targetUnit = obj->ToUnit(); Unit const* targetUnit = obj->ToUnit();
// If checking for alert, and creature's visibility range is greater than aggro distance, No alert // If checking for alert, and creature's visibility range is greater than aggro distance, No alert
@@ -2623,7 +2622,6 @@ void WorldObject::GetContactPoint(const WorldObject* obj, float& x, float& y, fl
} }
} }
void WorldObject::GetChargeContactPoint(const WorldObject* obj, float& x, float& y, float& z, float distance2d) const void WorldObject::GetChargeContactPoint(const WorldObject* obj, float& x, float& y, float& z, float distance2d) const
{ {
// angle to face `obj` to `this` using distance includes size of `obj` // angle to face `obj` to `this` using distance includes size of `obj`
@@ -2985,7 +2983,6 @@ void WorldObject::PlayDirectSound(uint32 sound_id, Player* target /*= NULL*/)
SendMessageToSet(&data, true); SendMessageToSet(&data, true);
} }
void WorldObject::PlayDirectMusic(uint32 music_id, Player* target /*= NULL*/) void WorldObject::PlayDirectMusic(uint32 music_id, Player* target /*= NULL*/)
{ {
WorldPacket data(SMSG_PLAY_MUSIC, 4); WorldPacket data(SMSG_PLAY_MUSIC, 4);

View File

@@ -485,7 +485,6 @@ struct Position
[[nodiscard]] Position GetPosition() const { return *this; } [[nodiscard]] Position GetPosition() const { return *this; }
Position::PositionXYZStreamer PositionXYZStream() Position::PositionXYZStreamer PositionXYZStream()
{ {
return PositionXYZStreamer(*this); return PositionXYZStreamer(*this);
@@ -593,7 +592,6 @@ ByteBuffer& operator >> (ByteBuffer& buf, Position::PositionXYZStreamer const& s
ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer); ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer);
ByteBuffer& operator >> (ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer); ByteBuffer& operator >> (ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer);
struct MovementInfo struct MovementInfo
{ {
// common // common

View File

@@ -142,4 +142,3 @@ void UpdateData::Clear()
m_outOfRangeGUIDs.clear(); m_outOfRangeGUIDs.clear();
m_blockCount = 0; m_blockCount = 0;
} }

View File

@@ -55,4 +55,3 @@ protected:
void Compress(void* dst, uint32* dst_size, void* src, int src_size); void Compress(void* dst, uint32* dst_size, void* src, int src_size);
}; };
#endif #endif

Some files were not shown because too many files have changed in this diff Show More