mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Eluna fix crash on reload eluna used from console
This commit is contained in:
@@ -463,8 +463,9 @@ bool Eluna::OnRemove(Player* pPlayer, Item* item)
|
|||||||
// Player
|
// Player
|
||||||
bool Eluna::OnCommand(Player* player, const char* text)
|
bool Eluna::OnCommand(Player* player, const char* text)
|
||||||
{
|
{
|
||||||
|
// If from console, player is NULL
|
||||||
std::string fullcmd(text);
|
std::string fullcmd(text);
|
||||||
if (player->GetSession()->GetSecurity() >= SEC_ADMINISTRATOR)
|
if (!player || player->GetSession()->GetSecurity() >= SEC_ADMINISTRATOR)
|
||||||
{
|
{
|
||||||
char* creload = strtok((char*)text, " ");
|
char* creload = strtok((char*)text, " ");
|
||||||
char* celuna = strtok(NULL, "");
|
char* celuna = strtok(NULL, "");
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ namespace HookMgr
|
|||||||
// UNUSED = 39, // (event, player)
|
// UNUSED = 39, // (event, player)
|
||||||
// UNUSED = 40, // (event, player)
|
// UNUSED = 40, // (event, player)
|
||||||
// UNUSED = 41, // (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
|
PLAYER_EVENT_COUNT
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user