*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)
|
if(!accessory)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!accessory->m_Vehicle)
|
||||||
|
{
|
||||||
accessory->m_Vehicle = this;
|
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
|
// This is not good, we have to send update twice
|
||||||
accessory->SendMovementFlagUpdate();
|
accessory->SendMovementFlagUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
|
bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
|
||||||
|
|||||||
Reference in New Issue
Block a user