mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 07:38:36 +00:00
[Bots] Cleanup and remove preprocessors. (#2757)
* [Bots] Cleanup and remove preprocessors. - Removes every `#ifdef BOTS` we have and locks bots behind `Bots:AllowBots` rule. - Bot updates are now done by default similar to regular database updates. - Modify `CMakeLists.txt`, `.drone.yml`, and `BUILD.md` to match the removal of `EQEMU_ENABLE_BOTS`. * Cleanup - Add SQL for enabling bots for servers with bots. - Add message that tells players/operators bots are disabled. * Suggested changes. * Bot injection stuff * Change SQL to bot SQL. * Tweaks * Remove `is_bot` * Update version.h * Update main.cpp * Update database.cpp * Fix name availability crash * Remove bots from update script Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
@@ -52,9 +52,7 @@
|
||||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
#ifdef BOTS
|
||||
#include "bot.h"
|
||||
#endif
|
||||
|
||||
extern Zone *zone;
|
||||
extern volatile bool is_zone_loaded;
|
||||
@@ -278,29 +276,15 @@ const Encounter* Entity::CastToEncounter() const
|
||||
return static_cast<const Encounter *>(this);
|
||||
}
|
||||
|
||||
#ifdef BOTS
|
||||
Bot *Entity::CastToBot()
|
||||
{
|
||||
#ifdef _EQDEBUG
|
||||
if (!IsBot()) {
|
||||
std::cout << "CastToBot error" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return static_cast<Bot *>(this);
|
||||
}
|
||||
|
||||
const Bot *Entity::CastToBot() const
|
||||
{
|
||||
#ifdef _EQDEBUG
|
||||
if (!IsBot()) {
|
||||
std::cout << "CastToBot error" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return static_cast<const Bot *>(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
EntityList::EntityList()
|
||||
:
|
||||
@@ -554,11 +538,9 @@ void EntityList::MobProcess()
|
||||
if(mob->IsMerc()) {
|
||||
entity_list.RemoveMerc(id);
|
||||
}
|
||||
#ifdef BOTS
|
||||
else if(mob->IsBot()) {
|
||||
entity_list.RemoveBot(id);
|
||||
}
|
||||
#endif
|
||||
else if(mob->IsNPC()) {
|
||||
entity_list.RemoveNPC(id);
|
||||
}
|
||||
@@ -1869,7 +1851,6 @@ Client *EntityList::GetClientByLSID(uint32 iLSID)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifdef BOTS
|
||||
Bot* EntityList::GetRandomBot(const glm::vec3& location, float distance, Bot* exclude_bot)
|
||||
{
|
||||
auto is_whole_zone = false;
|
||||
@@ -1900,7 +1881,6 @@ Bot* EntityList::GetRandomBot(const glm::vec3& location, float distance, Bot* ex
|
||||
return bots_in_range[zone->random.Int(0, bots_in_range.size() - 1)];
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
Client *EntityList::GetRandomClient(const glm::vec3& location, float distance, Client *exclude_client)
|
||||
{
|
||||
@@ -3145,13 +3125,8 @@ void EntityList::RemoveEntity(uint16 id)
|
||||
return;
|
||||
else if (entity_list.RemoveMerc(id))
|
||||
return;
|
||||
|
||||
#ifdef BOTS
|
||||
// This block of code is necessary to clean up bot objects
|
||||
else if (entity_list.RemoveBot(id))
|
||||
return;
|
||||
#endif //BOTS
|
||||
|
||||
else
|
||||
entity_list.RemoveObject(id);
|
||||
}
|
||||
@@ -5186,7 +5161,6 @@ void EntityList::GetClientList(std::list<Client *> &c_list)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BOTS
|
||||
void EntityList::GetBotList(std::list<Bot *> &b_list)
|
||||
{
|
||||
b_list.clear();
|
||||
@@ -5277,7 +5251,6 @@ void EntityList::SignalBotByBotName(std::string bot_name, int signal_id)
|
||||
b->Signal(signal_id);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void EntityList::GetCorpseList(std::list<Corpse *> &c_list)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user