Skip to content

Commit

Permalink
[9953] Remove two not needed cast to Creature* and make code more safe
Browse files Browse the repository at this point in the history
Signed-off-by: NoFantasy <nofantasy@nf.no>
  • Loading branch information
NoFantasy committed May 22, 2010
1 parent e91fbf9 commit 3cf7d7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/game/Player.cpp
Expand Up @@ -12564,7 +12564,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
if (pMenuItemBounds.first == pMenuItemBounds.second && menuId == GetDefaultGossipMenuForSource(pSource))
pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(0);

bool canTalkToCredit = true;
bool canTalkToCredit = pSource->GetTypeId() == TYPEID_UNIT;

for(GossipMenuItemsMap::const_iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
{
Expand Down Expand Up @@ -12656,8 +12656,6 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
{
GameObject *pGo = (GameObject*)pSource;

canTalkToCredit = false;

switch(itr->second.option_id)
{
case GOSSIP_OPTION_QUESTGIVER:
Expand Down Expand Up @@ -12704,7 +12702,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
if (canTalkToCredit)
{
if (pSource->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
TalkedToCreature(((Creature*)pSource)->GetEntry(), ((Creature*)pSource)->GetGUID());
TalkedToCreature(pSource->GetEntry(), pSource->GetGUID());
}

// some gossips aren't handled in normal way ... so we need to do it this way .. TODO: handle it in normal way ;-)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9952"
#define REVISION_NR "9953"
#endif // __REVISION_NR_H__

0 comments on commit 3cf7d7b

Please sign in to comment.