Merge remote branch 'origin/master' into 330

This commit is contained in:
tomrus88 2010-03-31 16:24:48 +04:00
commit 7403dee6e4
3 changed files with 9 additions and 9 deletions

View file

@ -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);
}
}

View file

@ -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);