Scripts/Commands: Fixed crashes in unstuck command

Closes #7754
This commit is contained in:
Shauren
2012-09-13 23:58:45 +02:00
parent f03e650474
commit 130cc423d2

View File

@@ -953,13 +953,12 @@ public:
if (!player_str)
return false;
std::string location_str = strtok(NULL, "");
if (location_str.empty())
location_str = "inn";
std::string location_str = "inn";
if (char const* loc = strtok(NULL, " "))
location_str = loc;
Player* player = NULL;
std::string playerName;
if (!handler->extractPlayerTarget((char*)player_str, &player, NULL, &playerName))
if (!handler->extractPlayerTarget(player_str, &player))
return false;
if (player->isInFlight() || player->isInCombat())