mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[9649] Replace some unnecessary Player::GetCorpse() calls.
Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
parent
41aee85145
commit
8b87c7ec97
3 changed files with 9 additions and 9 deletions
|
|
@ -4166,8 +4166,7 @@ void Player::BuildPlayerRepop()
|
|||
}
|
||||
|
||||
// create a corpse and place it at the player's location
|
||||
CreateCorpse();
|
||||
Corpse *corpse = GetCorpse();
|
||||
Corpse *corpse = CreateCorpse();
|
||||
if(!corpse)
|
||||
{
|
||||
sLog.outError("Error creating corpse for Player %s [%u]", GetName(), GetGUIDLow());
|
||||
|
|
@ -4293,7 +4292,7 @@ void Player::KillPlayer()
|
|||
UpdateObjectVisibility();
|
||||
}
|
||||
|
||||
void Player::CreateCorpse()
|
||||
Corpse* Player::CreateCorpse()
|
||||
{
|
||||
// prevent existence 2 corpse for player
|
||||
SpawnCorpseBones();
|
||||
|
|
@ -4306,7 +4305,7 @@ void Player::CreateCorpse()
|
|||
if(!corpse->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_CORPSE), this))
|
||||
{
|
||||
delete corpse;
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_uf = GetUInt32Value(UNIT_FIELD_BYTES_0);
|
||||
|
|
@ -4362,6 +4361,7 @@ void Player::CreateCorpse()
|
|||
|
||||
// register for player, but not show
|
||||
sObjectAccessor.AddCorpse(corpse);
|
||||
return corpse;
|
||||
}
|
||||
|
||||
void Player::SpawnCorpseBones()
|
||||
|
|
@ -13969,7 +13969,7 @@ void Player::GroupEventHappens( uint32 questId, WorldObject const* pEventObject
|
|||
Player *pGroupGuy = itr->getSource();
|
||||
|
||||
// for any leave or dead (with not released body) group member at appropriate distance
|
||||
if( pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(pEventObject) && !pGroupGuy->GetCorpse() )
|
||||
if( pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(pEventObject) && !pGroupGuy->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST) )
|
||||
pGroupGuy->AreaExploredOrEventHappens(questId);
|
||||
}
|
||||
}
|
||||
|
|
@ -19777,7 +19777,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
|
|||
}
|
||||
|
||||
// quest objectives updated only for alive group member or dead but with not released body
|
||||
if(pGroupGuy->isAlive()|| !pGroupGuy->GetCorpse())
|
||||
if(pGroupGuy->isAlive()|| !pGroupGuy->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
{
|
||||
// normal creature (not pet/etc) can be only in !PvP case
|
||||
if(pVictim->GetTypeId()==TYPEID_UNIT)
|
||||
|
|
@ -19829,7 +19829,7 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
|
|||
continue; // member (alive or dead) or his corpse at req. distance
|
||||
|
||||
// quest objectives updated only for alive group member or dead but with not released body
|
||||
if(pGroupGuy->isAlive()|| !pGroupGuy->GetCorpse())
|
||||
if(pGroupGuy->isAlive()|| !pGroupGuy->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
pGroupGuy->KilledMonsterCredit(creature_id, creature_guid);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1810,7 +1810,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
|
||||
Corpse *GetCorpse() const;
|
||||
void SpawnCorpseBones();
|
||||
void CreateCorpse();
|
||||
Corpse* CreateCorpse();
|
||||
void KillPlayer();
|
||||
uint32 GetResurrectionSpellId();
|
||||
void ResurrectPlayer(float restore_percent, bool applySickness = false);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9648"
|
||||
#define REVISION_NR "9649"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue