mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[9652] Avoid corpse save at arenas also, small cleanups.
This commit is contained in:
parent
09b873a316
commit
d004549fd4
2 changed files with 8 additions and 10 deletions
|
|
@ -4302,7 +4302,7 @@ Corpse* Player::CreateCorpse()
|
||||||
Corpse *corpse = new Corpse( (m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH) ? CORPSE_RESURRECTABLE_PVP : CORPSE_RESURRECTABLE_PVE );
|
Corpse *corpse = new Corpse( (m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH) ? CORPSE_RESURRECTABLE_PVP : CORPSE_RESURRECTABLE_PVE );
|
||||||
SetPvPDeath(false);
|
SetPvPDeath(false);
|
||||||
|
|
||||||
if(!corpse->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_CORPSE), this))
|
if (!corpse->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_CORPSE), this))
|
||||||
{
|
{
|
||||||
delete corpse;
|
delete corpse;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -4326,11 +4326,11 @@ Corpse* Player::CreateCorpse()
|
||||||
corpse->SetUInt32Value( CORPSE_FIELD_BYTES_2, _cfb2 );
|
corpse->SetUInt32Value( CORPSE_FIELD_BYTES_2, _cfb2 );
|
||||||
|
|
||||||
uint32 flags = CORPSE_FLAG_UNK2;
|
uint32 flags = CORPSE_FLAG_UNK2;
|
||||||
if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM))
|
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM))
|
||||||
flags |= CORPSE_FLAG_HIDE_HELM;
|
flags |= CORPSE_FLAG_HIDE_HELM;
|
||||||
if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK))
|
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK))
|
||||||
flags |= CORPSE_FLAG_HIDE_CLOAK;
|
flags |= CORPSE_FLAG_HIDE_CLOAK;
|
||||||
if(InBattleGround() && !InArena())
|
if (InBattleGround() && !InArena())
|
||||||
flags |= CORPSE_FLAG_LOOTABLE; // to be able to remove insignia
|
flags |= CORPSE_FLAG_LOOTABLE; // to be able to remove insignia
|
||||||
corpse->SetUInt32Value( CORPSE_FIELD_FLAGS, flags );
|
corpse->SetUInt32Value( CORPSE_FIELD_FLAGS, flags );
|
||||||
|
|
||||||
|
|
@ -4343,7 +4343,7 @@ Corpse* Player::CreateCorpse()
|
||||||
uint32 _cfi;
|
uint32 _cfi;
|
||||||
for (int i = 0; i < EQUIPMENT_SLOT_END; ++i)
|
for (int i = 0; i < EQUIPMENT_SLOT_END; ++i)
|
||||||
{
|
{
|
||||||
if(m_items[i])
|
if (m_items[i])
|
||||||
{
|
{
|
||||||
iDisplayID = m_items[i]->GetProto()->DisplayInfoID;
|
iDisplayID = m_items[i]->GetProto()->DisplayInfoID;
|
||||||
iIventoryType = m_items[i]->GetProto()->InventoryType;
|
iIventoryType = m_items[i]->GetProto()->InventoryType;
|
||||||
|
|
@ -4353,10 +4353,8 @@ Corpse* Player::CreateCorpse()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// we don't SaveToDB for players in battlegrounds so don't do it for corpses either
|
// we not need saved corpses for BG/arenas
|
||||||
const MapEntry *entry = sMapStore.LookupEntry(corpse->GetMapId());
|
if (!GetMap()->IsBattleGroundOrArena())
|
||||||
ASSERT(entry);
|
|
||||||
if(entry->map_type != MAP_BATTLEGROUND)
|
|
||||||
corpse->SaveToDB();
|
corpse->SaveToDB();
|
||||||
|
|
||||||
// register for player, but not show
|
// register for player, but not show
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9651"
|
#define REVISION_NR "9652"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue