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