aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/Logging/Appender.h4
-rw-r--r--src/common/Logging/AppenderFile.cpp2
-rw-r--r--src/common/Logging/Log.cpp2
-rw-r--r--src/server/game/Accounts/RBAC.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp10
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp26
6 files changed, 40 insertions, 6 deletions
diff --git a/src/common/Logging/Appender.h b/src/common/Logging/Appender.h
index 7c5aa41924d..6382399a0b4 100644
--- a/src/common/Logging/Appender.h
+++ b/src/common/Logging/Appender.h
@@ -126,9 +126,7 @@ Appender* CreateAppender(uint8 id, std::string const& name, LogLevel level, Appe
class InvalidAppenderArgsException : public std::length_error
{
public:
- using std::length_error::length_error;
-
- explicit InvalidAppenderArgsException(std::string const& message) : length_error(message) { }
+ explicit InvalidAppenderArgsException(std::string const& message) : std::length_error(message) { }
};
#endif
diff --git a/src/common/Logging/AppenderFile.cpp b/src/common/Logging/AppenderFile.cpp
index d33818626fe..c90c8f6ccea 100644
--- a/src/common/Logging/AppenderFile.cpp
+++ b/src/common/Logging/AppenderFile.cpp
@@ -50,6 +50,8 @@ AppenderFile::AppenderFile(uint8 id, std::string const& name, LogLevel level, Ap
if (extraArgs.size() > 2)
_maxFileSize = atoi(extraArgs[2]);
+ else
+ _maxFileSize = 0;
_dynamicName = std::string::npos != _fileName.find("%s");
_backup = (flags & APPENDER_FLAGS_MAKE_FILE_BACKUP) != 0;
diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp
index 93b7b9d122e..57d399a9d96 100644
--- a/src/common/Logging/Log.cpp
+++ b/src/common/Logging/Log.cpp
@@ -27,7 +27,7 @@
#include <cstdio>
#include <sstream>
-Log::Log() : _ioService(nullptr), _strand(nullptr)
+Log::Log() : AppenderId(0), lowestLogLevel(LOG_LEVEL_FATAL), _ioService(nullptr), _strand(nullptr)
{
m_logsTimestamp = "_" + GetTimestampStr();
RegisterAppender<AppenderConsole>();
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h
index bf28d76ab9c..805f613155d 100644
--- a/src/server/game/Accounts/RBAC.h
+++ b/src/server/game/Accounts/RBAC.h
@@ -694,6 +694,8 @@ enum RBACPermissions
RBAC_PERM_COMMAND_INSTANCE_GET_BOSS_STATE = 796,
RBAC_PERM_COMMAND_PVPSTATS = 797,
RBAC_PERM_COMMAND_MODIFY_XP = 798,
+ // 799 - 834 6.x only
+ RBAC_PERM_COMMAND_DEBUG_LOADCELLS = 835,
// custom permissions 1000+
RBAC_PERM_MAX
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 9ba7a62e215..f7491175a50 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1278,8 +1278,14 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
{
// Use the new aura to see on what stance the target will be
- uint32 newStance = (1<<((newAura ? newAura->GetMiscValue() : 0)-1));
-
+ uint32 newStance = 0;
+ if (newAura)
+ {
+ if (newAura->GetMiscValue() > 0 && newAura->GetMiscValue() <= 32) //Not null and GetMiscValue is not == FORM_NONE
+ newStance = 1 << (newAura->GetMiscValue() - 1);
+ else
+ TC_LOG_ERROR("spell.aura", "newAura->GetMiscValue() returned value %i for SpellID: %u when it was expecting a value in range [0..31] for a bitshift", newAura->GetMiscValue(), newAura->GetId());
+ }
// If the stances are not compatible with the spell, remove it
if (itr->second->GetBase()->IsRemovedOnShapeLost(target) && !(itr->second->GetBase()->GetSpellInfo()->Stances & newStance))
target->RemoveAura(itr);
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index ccd82aa3ef9..7c2ce1a13ec 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -33,6 +33,7 @@ EndScriptData */
#include "GossipDef.h"
#include "Transport.h"
#include "Language.h"
+#include "MapManager.h"
#include <fstream>
@@ -93,6 +94,7 @@ public:
{ "los", rbac::RBAC_PERM_COMMAND_DEBUG_LOS, false, &HandleDebugLoSCommand, "", NULL },
{ "moveflags", rbac::RBAC_PERM_COMMAND_DEBUG_MOVEFLAGS, false, &HandleDebugMoveflagsCommand, "", NULL },
{ "transport", rbac::RBAC_PERM_COMMAND_DEBUG_TRANSPORT, false, &HandleDebugTransportCommand, "", NULL },
+ { "loadcells", rbac::RBAC_PERM_COMMAND_DEBUG_LOADCELLS, false, &HandleDebugLoadCellsCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
@@ -1391,6 +1393,30 @@ public:
handler->PSendSysMessage("Transport %s %s", transport->GetName().c_str(), start ? "started" : "stopped");
return true;
}
+
+ static bool HandleDebugLoadCellsCommand(ChatHandler* handler, char const* args)
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+ if (!player)
+ return false;
+
+ Map* map = nullptr;
+
+ if (*args)
+ {
+ int32 mapId = atoi(args);
+ map = sMapMgr->FindBaseNonInstanceMap(mapId);
+ }
+ if (!map)
+ map = player->GetMap();
+
+ for (uint32 cellX = 0; cellX < TOTAL_NUMBER_OF_CELLS_PER_MAP; cellX++)
+ for (uint32 cellY = 0; cellY < TOTAL_NUMBER_OF_CELLS_PER_MAP; cellY++)
+ map->LoadGrid((cellX + 0.5f - CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL, (cellY + 0.5f - CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL);
+
+ handler->PSendSysMessage("Cells loaded (mapId: %u)", map->GetId());
+ return true;
+ }
};
void AddSC_debug_commandscript()