*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
+11 -4
View File
@@ -266,10 +266,17 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId)
if(!accessory) if(!accessory)
return; return;
accessory->m_Vehicle = this; if (!accessory->m_Vehicle)
AddPassenger(accessory, seatId); {
// This is not good, we have to send update twice accessory->m_Vehicle = this;
accessory->SendMovementFlagUpdate(); 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) bool Vehicle::AddPassenger(Unit *unit, int8 seatId)