From 5b2c61e95e3c46fbeaef53f4651c8198b68e4d3d Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 6 Jan 2009 13:50:42 -0600 Subject: [PATCH] *Mangos [7039] Implement mangosd.conf options Death.Bones. By VladimirMangos. *for disable bones creating from corpse in world zones or in arena/bg. *Note: in case apply insignia bones still created as required for looting. --HG-- branch : trunk --- src/game/GlobalEvents.cpp | 2 +- src/game/ObjectAccessor.cpp | 8 ++++++-- src/game/ObjectAccessor.h | 2 +- src/game/Player.cpp | 2 +- src/game/World.cpp | 2 ++ src/game/World.h | 2 ++ src/mangosd/mangosd.conf.dist.in | 8 ++++++++ src/shared/revision_nr.h | 2 +- 8 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/game/GlobalEvents.cpp b/src/game/GlobalEvents.cpp index 635d426f694..27de7df03b4 100644 --- a/src/game/GlobalEvents.cpp +++ b/src/game/GlobalEvents.cpp @@ -55,7 +55,7 @@ static void CorpsesEraseCallBack(QueryResult *result, bool bones) { if(!ObjectAccessor::Instance().ConvertCorpseForPlayer(player_guid)) { - sLog.outDebug("Corpse %u not found in world. Delete from DB.",guidlow); + sLog.outDebug("Corpse %u not found in world or bones creating forbidden. Delete from DB.",guidlow); CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow); } } diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 45429824b9c..872cf8280f5 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -38,6 +38,7 @@ #include "Opcodes.h" #include "ObjectDefines.h" #include "MapInstanced.h" +#include "World.h" #include @@ -432,7 +433,7 @@ ObjectAccessor::AddCorpsesToGrid(GridPair const& gridpair,GridType& grid,Map* ma } Corpse* -ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid) +ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia) { Corpse *corpse = GetCorpseForPlayerGUID(player_guid); if(!corpse) @@ -458,7 +459,10 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid) Corpse *bones = NULL; // create the bones only if the map and the grid is loaded at the corpse's location - if(map && !map->IsRemovalGrid(corpse->GetPositionX(), corpse->GetPositionY())) + // ignore bones creating option in case insignia + if (map && (insignia || + (map->IsBattleGroundOrArena() ? sWorld.getConfig(CONFIG_DEATH_BONES_BG_OR_ARENA) : sWorld.getConfig(CONFIG_DEATH_BONES_WORLD))) && + !map->IsRemovalGrid(corpse->GetPositionX(), corpse->GetPositionY())) { // Create bones, don't change Corpse bones = new Corpse; diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h index 91b80eaa7e1..3cb743be573 100644 --- a/src/game/ObjectAccessor.h +++ b/src/game/ObjectAccessor.h @@ -194,7 +194,7 @@ class TRINITY_DLL_DECL ObjectAccessor : public Trinity::Singleton