Skip to content

Instantly share code, notes, and snippets.

View Subv's full-sized avatar

Sebastian Valle Subv

  • Barranquilla, Colombia
View GitHub Profile
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index df2b9c3..9dd5625 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -486,9 +486,9 @@ SpellValue::SpellValue(SpellInfo const* proto)
AuraStackAmount = 1;
}
-Spell::Spell(Unit* caster, SpellInfo const* info, TriggerCastFlags triggerFlags, uint64 originalCasterGUID, bool skipCheck) :
+Spell::Spell(WorldObject* caster, SpellInfo const* info, TriggerCastFlags triggerFlags, uint64 originalCasterGUID, bool skipCheck) :
@Subv
Subv / gist:3734863
Created September 16, 2012 23:50
Battlegrounds, from @Flemzard
diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp
index cbaab48..490bf07 100644
--- a/src/server/game/Battlefield/Battlefield.cpp
+++ b/src/server/game/Battlefield/Battlefield.cpp
@@ -34,13 +34,12 @@
Battlefield::Battlefield()
{
- m_Guid = MAKE_NEW_GUID(m_TypeId, 0, HIGHGUID_TYPE_BATTLEGROUND);
-
#include "Common.h"
#include "LuaEngine.h"
#include "LuaInc.h"
#include "DBCStructure.h"
#include "Config.h"
using namespace luabind;
#define TRY(...) try{__VA_ARGS__} catch(cast_failed &e) { sLog->outString("An exception occurred in LuaBind (cast_failed), message: %s: %s.",e.what(),lua_tostring(m_luaState, -1)); } catch(error& ex) { sLog->outString("An exception occurred in LuaBind (error), message: %s: %s.",ex.what(),lua_tostring(m_luaState, -1)); }
/*void ErrorCallback(lua_State* l)
{
@Subv
Subv / SunDofus DB
Created October 19, 2013 20:22
New scheme for the SunDofus database, to fully leverage the concepts of relational databases.
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: file:///C:/Users/Sebastian/Documents/Utils/www%20SQL%20Designer/index.html -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="TINYINT" length="0" sql="TINYINT" quote=""/>
<type label="SMALLINT" length="0" sql="SMALLINT" quote=""/>
<type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote=""/>
<type label="INT" length="0" sql="INT" quote=""/>
@Subv
Subv / SunDofus 2
Created October 19, 2013 23:16
Another update for the schema of SunDofus's DB
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: file:///C:/Users/Sebastian/Documents/Utils/www%20SQL%20Designer/index.html -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="TINYINT" length="0" sql="TINYINT" quote=""/>
<type label="SMALLINT" length="0" sql="SMALLINT" quote=""/>
<type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote=""/>
<type label="INT" length="0" sql="INT" quote=""/>
@Subv
Subv / SunDofus Final DB Schema
Last active December 26, 2015 02:09
Final schema for the SunDofus emulator
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: file:///C:/Users/Sebastian/Documents/Utils/www%20SQL%20Designer/index.html -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="TINYINT" length="0" sql="TINYINT" quote=""/>
<type label="SMALLINT" length="0" sql="SMALLINT" quote=""/>
<type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote=""/>
<type label="INT" length="0" sql="INT" quote=""/>
@Subv
Subv / SQL Schema
Last active December 26, 2015 02:09
SQL for the db schema of SunDofus
-- ---
-- Globals
-- ---
-- SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- SET FOREIGN_KEY_CHECKS=0;
-- ---
-- Table 'characters'
==15034== 3 errors in context 1 of 8:
==15034== Thread 2:
==15034== Source and destination overlap in memcpy(0x12129c40, 0x12129c40, 12)
==15034== at 0x4C2E923: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15034== by 0x532AB7: removeVertex(rcContext*, rcPolyMesh&, unsigned short, int) (RecastMesh.cpp:664)
==15034== by 0x535192: rcBuildPolyMesh(rcContext*, rcContourSet&, int, rcPolyMesh&) (RecastMesh.cpp:1147)
==15034== by 0x4AD08D: TileBuilder::BuildTiled(dtNavMeshParams&) (TileBuilder.cpp:299)
==15034== by 0x4A890D: TileBuildRequest::call() (ContinentBuilder.cpp:159)
==15034== by 0x4A8E3C: BuilderThread::svc() (ContinentBuilder.h:102)
==15034== by 0x536BE56: ACE_Task_Base::svc_run(void*) (in /usr/lib/libACE-6.0.3.so)
@Subv
Subv / changes
Last active August 29, 2015 14:01
C++11 Changes from TC
ACE_Singleton
We can use a static class member and function, C++11 dictates that static variables are to be initialized by only one thread
Compiler Support:
- GCC4.3
- VS2013
Mutexes and Locks
We can replace some of the current ACE locking mechanism with:
- TRINITY_GUARD -> std::lock_guard
- ACE_Thread_Mutex -> std::mutex
@Subv
Subv / gist:6d6dda509c2480462aa6
Created June 1, 2014 03:40
Implement visibility based on phaseids
diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp
index a797f61..8fe286c 100644
--- a/src/server/game/Battlefield/Battlefield.cpp
+++ b/src/server/game/Battlefield/Battlefield.cpp
@@ -794,7 +794,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
}
Creature* creature = new Creature();
- if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, x, y, z, o))
+ if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, 0, entry, x, y, z, o))