Skip to content

Instantly share code, notes, and snippets.

@Shauren
Shauren / Console.cpp
Created February 22, 2016 17:09
open console & redirect there
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <cstdio>
#include <fcntl.h>
#include <io.h>
#include <streambuf>
void RedirectHandle(DWORD handle, FILE* file, char const* mode)
{
long lStdHandle = (long)GetStdHandle(handle);
@Shauren
Shauren / named_command_args.diff
Created August 2, 2017 20:24
TC named command args
diff --git a/src/common/Utilities/StringFormat.h b/src/common/Utilities/StringFormat.h
index 12eeb2a6d1..f44101224f 100644
--- a/src/common/Utilities/StringFormat.h
+++ b/src/common/Utilities/StringFormat.h
@@ -23,11 +23,51 @@
namespace Trinity
{
+ struct FmtArgWrapper
+ {
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index b394bc9..3b50526 100644
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -109,6 +109,35 @@ public:
uint32 GetTableRowCount() const { return _gtEntry->NumRows; }
uint32 GetTableColumnCount() const { return _gtEntry->NumColumns; }
+ std::string Dump()
+ {
@Shauren
Shauren / cpp14.cpp
Last active March 27, 2018 16:02
DB2 autoindexing
https://godbolt.org/g/G8mq4T // cpp14
#include <unordered_map>
#include <vector>
#include <boost/functional/hash.hpp>
#include <cstdint>
#include <cstdio>
template<typename C, typename R, R C::*M>
struct DB2Field {
diff --git a/WowPacketParser/Enums/UpdateFields.cs b/WowPacketParser/Enums/UpdateFields.cs
index a394691c1..7be6b5633 100644
--- a/WowPacketParser/Enums/UpdateFields.cs
+++ b/WowPacketParser/Enums/UpdateFields.cs
@@ -1,4 +1,5 @@
using WowPacketParser.Parsing;
+using WowPacketParser.Parsing.Parsers;
namespace WowPacketParser.Enums
{
@Shauren
Shauren / convert.cpp
Created December 30, 2018 17:56
npc_trainer converter
namespace TrinityOld
{
struct TrainerRequirement
{
uint32 trainer_type;
uint32 trainer_spell;
uint32 trainer_class;
uint32 trainer_race;
};
diff --git a/dep/boost/CMakeLists.txt b/dep/boost/CMakeLists.txt
index 57e9d0c4f6..4a2332c2c1 100644
--- a/dep/boost/CMakeLists.txt
+++ b/dep/boost/CMakeLists.txt
@@ -77,7 +77,8 @@ target_compile_definitions(boost
-DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
-DBOOST_CHRONO_NO_LIB
-DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE
- -DBOOST_ASIO_NO_DEPRECATED)
+ -DBOOST_ASIO_NO_DEPRECATED
diff --git a/RecastDemo/Source/NavMeshTesterTool.cpp b/RecastDemo/Source/NavMeshTesterTool.cpp
index 8b99ac7..8c48929 100644
--- a/RecastDemo/Source/NavMeshTesterTool.cpp
+++ b/RecastDemo/Source/NavMeshTesterTool.cpp
@@ -414,22 +414,22 @@ void NavMeshTesterTool::handleMenu()
imguiLabel("Include Flags");
imguiIndent();
- if (imguiCheck("Walk", (m_filter.getIncludeFlags() & SAMPLE_POLYFLAGS_WALK) != 0))
+ if (imguiCheck("Ground", (m_filter.getIncludeFlags() & SAMPLE_POLYFLAGS_WALK) != 0))
diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h
index d263be3efe..f45c586c0c 100644
--- a/src/common/Debugging/Errors.h
+++ b/src/common/Debugging/Errors.h
@@ -20,6 +20,8 @@
#define TRINITYCORE_ERRORS_H
#include "Define.h"
+#include <boost/preprocessor/facilities/overload.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index 4c333e6574..36f40e9a91 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -30,6 +30,7 @@
#include "ScriptMgr.h"
#include "SpellAuraEffects.h"
#include "TemporarySummon.h"
+#include "Transport.h"
#include "Unit.h"