*Add security check to Vehicle::InstallAccessory.
--HG-- branch : trunk
This commit is contained in:
@@ -266,10 +266,17 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId)
|
||||
if(!accessory)
|
||||
return;
|
||||
|
||||
if (!accessory->m_Vehicle)
|
||||
{
|
||||
accessory->m_Vehicle = this;
|
||||
AddPassenger(accessory, seatId);
|
||||
if (!AddPassenger(accessory, seatId))
|
||||
{
|
||||
accessory->m_Vehicle = NULL;
|
||||
return;
|
||||
}
|
||||
// This is not good, we have to send update twice
|
||||
accessory->SendMovementFlagUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
|
||||
|
||||
Reference in New Issue
Block a user