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
This commit is contained in:
1 parent
aeebe57dc0
commit
91b8ee104e
30 files changed
+674
-663
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user