Core/Players: Fixed issues with incorrect targets being selected for spells

This commit is contained in:
Shauren committed 2013-10-03 17:07:25 +02:00
1 parent dd4404e6e3
commit a368fae588
15 files changed
+93 -102

No files matched your search

+2 -7
View File
@@ -1297,22 +1297,17 @@ public:
char* receiver_str = strtok((char*)args, " ");
char* text = strtok(NULL, "");
uint64 guid = handler->GetSession()->GetPlayer()->GetSelection();
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(guid);
Creature* creature = handler->getSelectedCreature();
if (!creature || !receiver_str || !text)
{
return false;
}
uint64 receiver_guid= atol(receiver_str);
uint64 receiver_guid = atol(receiver_str);
// check online security
if (handler->HasLowerSecurity(ObjectAccessor::FindPlayer(receiver_guid), 0))
return false;
creature->MonsterWhisper(text, receiver_guid);
return true;
}