From 91b8ee104eac7446f9b8cbea7ed9dce641740c8e Mon Sep 17 00:00:00 2001 From: raczman Date: Sun, 7 Mar 2010 15:20:19 +0100 Subject: Added new type-safe cast functions. This, when properly used, should get rid of most memory corruption issues, currently, casting types C-style with no checks leads to some abstract crashing. Functionality is same as with dynamic_cast<>, but with no RTTI check - so when casting into invalid type you will receive NULL, and most probably crash. At the same time, i took the liberty to convert most Player* casts to ToPlayer(). Still needs crapload of casts being moved to new facility. --HG-- branch : trunk --- src/game/Vehicle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/game/Vehicle.cpp') diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index 09f1e8c2ade..bf7ecef399a 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -338,7 +338,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) } //if(unit->GetTypeId() == TYPEID_PLAYER) - // ((Player*)unit)->SendTeleportAckMsg(); + // unit->ToPlayer()->SendTeleportAckMsg(); //unit->SendMovementFlagUpdate(); return true; -- cgit v1.2.3