Eluna fix crash on reload eluna used from console

This commit is contained in:
Rochet2
2014-06-15 12:53:13 +03:00
committed by Foereaper
parent 2d81bd23eb
commit 79fd1d5bab
2 changed files with 3 additions and 2 deletions

View File

@@ -463,8 +463,9 @@ bool Eluna::OnRemove(Player* pPlayer, Item* item)
// Player
bool Eluna::OnCommand(Player* player, const char* text)
{
// If from console, player is NULL
std::string fullcmd(text);
if (player->GetSession()->GetSecurity() >= SEC_ADMINISTRATOR)
if (!player || player->GetSession()->GetSecurity() >= SEC_ADMINISTRATOR)
{
char* creload = strtok((char*)text, " ");
char* celuna = strtok(NULL, "");

View File

@@ -135,7 +135,7 @@ namespace HookMgr
// UNUSED = 39, // (event, player)
// UNUSED = 40, // (event, player)
// UNUSED = 41, // (event, player)
PLAYER_EVENT_ON_COMMAND = 42, // (event, player, command) - Can return false
PLAYER_EVENT_ON_COMMAND = 42, // (event, player, command) - player is nil if command used from console. Can return false
PLAYER_EVENT_COUNT
};