Skip to content
Browse files

[2503] Add params to GetClosesCreatureWithEntry to also select corpse…

… or alive/corpse creatures. Requires MaNGOS 11942
  • Loading branch information...
1 parent ccf6901 commit af2c044903c44221d309b6184f0a2b6fd7882845 @Schmoozerd Schmoozerd committed Apr 6, 2012
View
4 include/sc_grid_searchers.cpp
@@ -18,11 +18,11 @@ GameObject* GetClosestGameObjectWithEntry(WorldObject* pSource, uint32 uiEntry,
}
//return closest creature alive in grid, with range from pSource
-Creature* GetClosestCreatureWithEntry(WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange)
+Creature* GetClosestCreatureWithEntry(WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange, bool bOnlyAlive/*=true*/, bool bOnlyDead/*=false*/)
{
Creature* pCreature = NULL;
- MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*pSource, uiEntry, true, fMaxSearchRange);
+ MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*pSource, uiEntry, bOnlyAlive, bOnlyDead, fMaxSearchRange);
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check);
Cell::VisitGridObjects(pSource, searcher, fMaxSearchRange);
View
2 include/sc_grid_searchers.h
@@ -38,7 +38,7 @@ struct ObjectDistanceOrderReversed : public std::binary_function<const WorldObje
};
GameObject* GetClosestGameObjectWithEntry(WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange);
-Creature* GetClosestCreatureWithEntry(WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange);
+Creature* GetClosestCreatureWithEntry(WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange, bool bOnlyAlive = true, bool bOnlyDead = false);
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList , WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange);
void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange);
View
2 sd2_revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_NR_H__
#define __SD2_REVISION_NR_H__
- #define SD2_REVISION_NR "2502"
+ #define SD2_REVISION_NR "2503"
#endif // __SD2_REVISION_NR_H__
View
2 sql/scriptdev2_script_full.sql
@@ -3,7 +3,7 @@
--
DELETE FROM sd2_db_version;
-INSERT INTO sd2_db_version (version) VALUES ('ScriptDev2 (for MaNGOS 11812+) ');
+INSERT INTO sd2_db_version (version) VALUES ('ScriptDev2 (for MaNGOS 11942+) ');
--
-- Below contains data for table `script_texts` mainly used in C++ parts.
View
1 sql/updates/r2503_scriptdev2.sql
@@ -0,0 +1 @@
+UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 11942+) ';

0 comments on commit af2c044

Please sign in to comment.
Something went wrong with that request. Please try again.