*Add security check to Vehicle::InstallAccessory.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-06-24 01:50:59 +02:00
parent 0a7691083d
commit e58230d506
+8 -1
View File
@@ -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)