Core/Players: Implement generic SendClearFocus instead of magic SMSG_BREAK_PACKET randomly in the middle of code. Also preallocate correct size for packed guid.

This commit is contained in:
Machiavelli
2011-01-25 08:04:47 +01:00
parent 6dbae56f57
commit 17971acddb
3 changed files with 9 additions and 3 deletions
@@ -24531,3 +24531,10 @@ void Player::_SaveInstanceTimeRestrictions(SQLTransaction& trans)
trans->Append(stmt);
}
}
void Player::SendClearFocus(Unit* target)
{
WorldPacket data(SMSG_BREAK_TARGET, target->GetPackGUID().size());
data.append(target->GetPackGUID());
GetSession()->SendPacket(&data);
}
+1
View File
@@ -2281,6 +2281,7 @@ class Player : public Unit, public GridObject<Player>
void SendCinematicStart(uint32 CinematicSequenceId);
void SendMovieStart(uint32 MovieId);
void SendClearFocus(Unit* target);
/*********************************************************/
/*** INSTANCE SYSTEM ***/
+1 -3
View File
@@ -16411,9 +16411,7 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const * a
WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
thisPlr->GetSession()->SendPacket(&data);
data.Initialize(SMSG_BREAK_TARGET, 7);
data.append(vehicle->GetBase()->GetPackGUID());
thisPlr->GetSession()->SendPacket(&data);
thisPlr->SendClearFocus(vehicle->GetBase());
}
SetControlled(true, UNIT_STAT_ROOT);