Skip to content

Instantly share code, notes, and snippets.

@vermie
vermie / gist:861674
Created March 9, 2011 04:02
mmaps_one patch ONE
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 8a45c6b..138ce3c 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -11942,10 +11942,9 @@ void Unit::SendMonsterMoveByPath(Path<Elem,Node> const& path, uint32 start, uint
return;
}
- uint32 packSize = (flags & SplineFlags(SPLINEFLAG_FLYING | SPLINEFLAG_CATMULLROM)) ? pathSize*4*3 : 4*3 + (pathSize-1)*4;
- WorldPacket data( SMSG_MONSTER_MOVE, (GetPackGUID().size()+1+4+4+4+4+1+4+4+4+packSize) );
@vermie
vermie / gist:842876
Created February 24, 2011 21:00
check tile exists
diff --git a/src/game/PathFinder.cpp b/src/game/PathFinder.cpp
index d343503..082c6dd 100644
--- a/src/game/PathFinder.cpp
+++ b/src/game/PathFinder.cpp
@@ -81,7 +81,8 @@ bool PathInfo::Update(const float destX, const float destY, const float destZ, b
PATH_DEBUG("++ PathInfo::Update() for %u \n", m_sourceUnit->GetGUID());
// make sure navMesh works - we can run on map w/o mmap
- if (!m_navMesh || !m_navMeshQuery || m_sourceUnit->hasUnitState(UNIT_STAT_IGNORE_PATHFINDING))
+ if (m_sourceUnit->hasUnitState(UNIT_STAT_IGNORE_PATHFINDING) ||
+ [9995] c0f1724f71cd1be8479163e6fee11d199c58523b map api
+ [10002] 8f2b05c0959cb38155d227efe8e9d0a8ce52002c map api
+ [10161] 32c1fe65b247e3ff51af16d3e19e09c5585cd31d vmaps dep bzip2
+ [10162] d3a626efbb90ee48c315ce5533de0d7f5cf239fd vmaps dep libmpq
+ [10163] f9b06d9b2c406a29b076db44e708a2dad4ac7e8d vmaps v3 extractor not tested on *expansion*.mpq
+ [10164] 52a0d242272665663d4c2752d91b3f17977ba860 vmaps v3 assembler
- [s0158] 43694467bea190b0e5d7690381fb34b4b14c9bb2 revert getheight calc
+ [10165] 76676ba0e5c16da3595a9b1e948f4b7eeadfa8d2 vmaps v3 review Unit::RemoveAurasWithAttrubute
+ [10166] 6fa16c6a5589b5bf772c75b0e0efc2f774ab4fcf drop stormlib
+ [10167] b55e1b51648e0a5ec433189a833c22d30455287a vmaps v3
@vermie
vermie / gist:791419
Created January 22, 2011 20:06
ChargeMovementGenerator
diff --git a/src/game/ChargeMovementGenerator.cpp b/src/game/ChargeMovementGenerator.cpp
new file mode 100644
index 0000000..73838f2
--- /dev/null
+++ b/src/game/ChargeMovementGenerator.cpp
@@ -0,0 +1,126 @@
+
+#include "ChargeMovementGenerator.h"
+
+template<class T, class U>
@vermie
vermie / gist:777044
Created January 12, 2011 22:41
pet behavior
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 52f78e9..e21f71b 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -1431,6 +1431,10 @@ void Creature::SetDeathState(DeathState s)
UpdateSpeed(MOVE_RUN, false);
}
+ // FIXME: may not be blizzlike
+ if (Pet* pet = GetPet())
@vermie
vermie / gist:770697
Created January 8, 2011 08:56
timer
struct LightTimer
{
public:
LightTimer() : i_expiryTime(0) {}
explicit LightTimer(uint32 expiry) : i_expiryTime(expiry) {}
//if Update() returns true - timer has elapsed
//and you should call Reset() method
bool Elapsed(uint32 diff) { return (i_expiryTime -= diff) < 0; }
@vermie
vermie / gist:726329
Created December 2, 2010 23:43
solomesh tile approach
diff --git a/contrib/mmap/src/MapBuilder.cpp b/contrib/mmap/src/MapBuilder.cpp
index 43330f5..453b936 100644
--- a/contrib/mmap/src/MapBuilder.cpp
+++ b/contrib/mmap/src/MapBuilder.cpp
@@ -650,10 +650,9 @@ namespace MMAP
// old code for non-statically assigned bitmask sizes:
///*** calculate number of bits needed to store tiles & polys ***/
- //uint32 tileCount = tiles->size() * rcSqr(TILES_PER_MMTILE);
- //tileBits = dtIlog2(dtNextPow2(tileCount);
@vermie
vermie / gist:712419
Created November 23, 2010 20:01
generator for multiple dtTiles per mmtile
diff --git a/contrib/mmap/src/MapBuilder.cpp b/contrib/mmap/src/MapBuilder.cpp
index dde03c7..546085c 100644
--- a/contrib/mmap/src/MapBuilder.cpp
+++ b/contrib/mmap/src/MapBuilder.cpp
@@ -39,12 +39,15 @@ namespace MMAP
m_skipJunkMaps (skipJunkMaps),
m_skipBattlegrounds (skipBattlegrounds),
m_maxWalkableAngle (maxWalkableAngle),
- m_newTilesOnly (newTilesOnly)
+ m_newTilesOnly (newTilesOnly),
@vermie
vermie / gist:674959
Created November 13, 2010 00:31
changes to mmtile format
diff --git a/contrib/mmap/src/MapBuilder.cpp b/contrib/mmap/src/MapBuilder.cpp
index e7fc2e3..dde03c7 100644
--- a/contrib/mmap/src/MapBuilder.cpp
+++ b/contrib/mmap/src/MapBuilder.cpp
@@ -31,14 +31,15 @@ namespace MMAP
MapBuilder::MapBuilder(float maxWalkableAngle,
bool skipLiquid,
bool skipContinents, bool skipJunkMaps, bool skipBattlegrounds,
- bool hiResHeightmaps, bool debugOutput) :
+ bool hiResHeightmaps, bool debugOutput, bool newTilesOnly) :
@vermie
vermie / gist:669532
Created November 9, 2010 18:22
file load err reporting
diff --git a/src/game/MoveMap.cpp b/src/game/MoveMap.cpp
index 0dbdef4..094a9cf 100644
--- a/src/game/MoveMap.cpp
+++ b/src/game/MoveMap.cpp
@@ -36,6 +36,7 @@ void Map::LoadNavMesh(int gx, int gy)
if(!file)
{
sLog.outDebug("Error: Could not open mmap file '%s'", fileName);
+ perror(fileName);
delete [] fileName;