diff --git a/src/game/Player.cpp b/src/game/Player.cpp index c3d912115..138383779 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -4182,8 +4182,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()); @@ -4309,7 +4308,7 @@ void Player::KillPlayer() UpdateObjectVisibility(); } -void Player::CreateCorpse() +Corpse* Player::CreateCorpse() { // prevent existence 2 corpse for player SpawnCorpseBones(); @@ -4322,7 +4321,7 @@ void Player::CreateCorpse() if(!corpse->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_CORPSE), this)) { delete corpse; - return; + return NULL; } _uf = GetUInt32Value(UNIT_FIELD_BYTES_0); @@ -4378,6 +4377,7 @@ void Player::CreateCorpse() // register for player, but not show sObjectAccessor.AddCorpse(corpse); + return corpse; } void Player::SpawnCorpseBones() @@ -13999,7 +13999,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); } } @@ -19805,7 +19805,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) @@ -19857,7 +19857,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); } } diff --git a/src/game/Player.h b/src/game/Player.h index 98951f54e..4d8e2fb83 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1814,7 +1814,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); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 49dfcaf4a..fd7738aec 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9648" + #define REVISION_NR "9649" #endif // __REVISION_NR_H__