Some Creature* casts moved to new ToCreature.

Added const Creature* ToCreature()

--HG--
branch : trunk
This commit is contained in:
raczman
2010-03-07 18:30:53 +01:00
parent 9a8f10fa30
commit 07f3b91426
29 changed files with 280 additions and 279 deletions
+3 -3
View File
@@ -53,7 +53,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode( WorldPacket & recv_data )
case TYPEID_UNIT:
{
sLog.outDebug( "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u",uint32(GUID_LOPART(guid)) );
Creature* cr_questgiver=(Creature*)questgiver;
Creature* cr_questgiver=questgiver->ToCreature();
if( !cr_questgiver->IsHostileTo(_player)) // not show quest status to enemies
{
questStatus = sScriptMgr.NPCDialogStatus(_player, cr_questgiver);
@@ -188,7 +188,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
switch(pObject->GetTypeId())
{
case TYPEID_UNIT:
sScriptMgr.QuestAccept(_player, ((Creature*)pObject), qInfo );
sScriptMgr.QuestAccept(_player, (pObject->ToCreature()), qInfo );
break;
case TYPEID_ITEM:
case TYPEID_CONTAINER:
@@ -297,7 +297,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode( WorldPacket & recv_data )
switch(pObject->GetTypeId())
{
case TYPEID_UNIT:
if( !(sScriptMgr.ChooseReward( _player, ((Creature*)pObject), pQuest, reward )) )
if( !(sScriptMgr.ChooseReward( _player, (pObject->ToCreature()), pQuest, reward )) )
{
// Send next quest
if(Quest const* nextquest = _player->GetNextQuest( guid ,pQuest ) )