Skip to content

Instantly share code, notes, and snippets.

@Shauren
Shauren / UniqueTrackingPtr.cpp
Created March 11, 2024 12:24
UniqueTrackingPtr demo
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h
index 0a7e10a34f..679497173f 100644
--- a/src/server/game/AI/CoreAI/UnitAI.h
+++ b/src/server/game/AI/CoreAI/UnitAI.h
@@ -257,6 +257,8 @@ class TC_GAME_API UnitAI
virtual std::string GetDebugInfo() const;
+ Unit* GetUnit() const { return me; }
+
class AccountObjectSetCheats
{
bool AutoBattle = false;
AccountobjectSetCheats Type;
int8 SlotLockCheat = 0;
};
class AccountObjectGetProfile
{
std::string Filename;
@Shauren
Shauren / wse.sql
Last active December 29, 2022 21:07
9.2.5 WorldStateExpression
This file has been truncated, but you can view the full file.
INSERT INTO `world_state_expression_parsed` (ID, `Text`) VALUES
(44, "WorldState(63) < WorldState(62)"),
(61, "WSE_FUNCTION_RANDOM(50, 75) != 0"),
(63, "(WorldState(63) + 1) != 0"),
(67, "WorldState(63) > WorldState(62)"),
(82, "(WorldState(63) > WorldState(62)) && WorldState(41) < 2"),
(102, "(WorldState(63) > WorldState(62)) && WorldState(81) == 0"),
(103, "WorldState(41) <= 0"),
(104, "WorldState(41) == 1"),
(105, "WorldState(41) >= 2"),
@Shauren
Shauren / CMakeCache.txt
Last active July 5, 2022 08:31
build boost with clang
# This is the CMakeCache file.
# For build in directory: /home/shauren/projects/TrinityCore/build
# It was generated by CMake: /usr/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
@Shauren
Shauren / definitely_broken.txt
Last active October 22, 2021 19:18
gameobjects with regular rotation in gameobject_addon parent_rotation fields
1374
1498
4599
5141
5205
5382
5398
5405
5425
7100
@Shauren
Shauren / Main.lua
Created November 13, 2020 13:39
TomCat built in pins
local addon = select(2, ...)
local D, _, P = addon.getLocalVars()
local TCL = addon.TomCatsLibs
local QUEST_STATUS, windowSettings
local GetVignettes_Orig = C_VignetteInfo.GetVignettes
local zoneMapID = 118
local function suppressVignettes()
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"
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/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))