diff --git a/src/LuaEngine/LuaFunctions.cpp b/src/LuaEngine/LuaFunctions.cpp index c029fd3..dd305fc 100644 --- a/src/LuaEngine/LuaFunctions.cpp +++ b/src/LuaEngine/LuaFunctions.cpp @@ -708,6 +708,7 @@ ALERegister PlayerMethods[] = { "CanTeleport", &LuaPlayer::CanTeleport }, { "IsSpectator", &LuaPlayer::IsSpectator }, { "HasKnownTaxiNode", &LuaPlayer::HasKnownTaxiNode }, + { "IsBot", &LuaPlayer::IsBot }, // { "HasSpellMod", &LuaPlayer::HasSpellMod }, // Gossip diff --git a/src/LuaEngine/methods/PlayerMethods.h b/src/LuaEngine/methods/PlayerMethods.h index 1e94d19..b3bb308 100644 --- a/src/LuaEngine/methods/PlayerMethods.h +++ b/src/LuaEngine/methods/PlayerMethods.h @@ -5009,6 +5009,22 @@ namespace LuaPlayer ALE::Push(L, player->m_taxi.IsTaximaskNodeKnown(nodeId)); return 1; } + + /** + * Returns `true` if the [Player] is a Playerbot/RNDBot, `false` otherwise. + * + * @return bool isBot + */ + int IsBot(lua_State* L, Player* player) + { + #if defined(MOD_PLAYERBOTS) + ALE::Push(L, player->GetSession()->IsBot()); + #else + (void)player; + ALE::Push(L, false); + #endif + return 1; + } }; #endif