diff options
author | raczman <none@none> | 2010-03-07 15:20:19 +0100 |
---|---|---|
committer | raczman <none@none> | 2010-03-07 15:20:19 +0100 |
commit | 91b8ee104eac7446f9b8cbea7ed9dce641740c8e (patch) | |
tree | 2866b76745089d8066dad65b63e5aff07e92f4f6 /src/game/OutdoorPvPHP.cpp | |
parent | aeebe57dc08d8b2d90972f50f00c4a28dd3947ba (diff) |
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
Diffstat (limited to 'src/game/OutdoorPvPHP.cpp')
-rw-r--r-- | src/game/OutdoorPvPHP.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/OutdoorPvPHP.cpp b/src/game/OutdoorPvPHP.cpp index 20c30cfeda8..fa1b89180a5 100644 --- a/src/game/OutdoorPvPHP.cpp +++ b/src/game/OutdoorPvPHP.cpp @@ -325,8 +325,8 @@ void OutdoorPvPHP::HandleKillImpl(Player *plr, Unit * killed) if(killed->GetTypeId() != TYPEID_PLAYER) return; - if(plr->GetTeam() == ALLIANCE && ((Player*)killed)->GetTeam() != ALLIANCE) + if(plr->GetTeam() == ALLIANCE && killed->ToPlayer()->GetTeam() != ALLIANCE) plr->CastSpell(plr,AlliancePlayerKillReward,true); - else if(plr->GetTeam() == HORDE && ((Player*)killed)->GetTeam() != HORDE) + else if(plr->GetTeam() == HORDE && killed->ToPlayer()->GetTeam() != HORDE) plr->CastSpell(plr,HordePlayerKillReward,true); } |