mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
Added const cast Entity::CastToBot()
This commit is contained in:
parent
ca874cb861
commit
e903b06c22
@ -735,6 +735,7 @@ type', in which case, the answer is yes.
|
||||
}
|
||||
|
||||
#ifdef BOTS
|
||||
// this is HIGHLY inefficient
|
||||
bool HasRuleDefined = false;
|
||||
bool IsBotAttackAllowed = false;
|
||||
IsBotAttackAllowed = Bot::IsBotAttackAllowed(mob1, mob2, HasRuleDefined);
|
||||
|
||||
@ -286,6 +286,17 @@ Bot *Entity::CastToBot()
|
||||
#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()
|
||||
|
||||
@ -116,6 +116,7 @@ public:
|
||||
|
||||
#ifdef BOTS
|
||||
Bot* CastToBot();
|
||||
const Bot* CastToBot() const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
@ -1233,15 +1233,17 @@ XS(XS_Client_MovePC) {
|
||||
if (THIS->IsMerc()) {
|
||||
Log(Logs::Detail, Logs::None,
|
||||
"[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference");
|
||||
} else if (THIS->IsNPC()) {
|
||||
}
|
||||
#ifdef BOTS
|
||||
else if (THIS->IsBot()) {
|
||||
Log(Logs::Detail, Logs::None,
|
||||
"[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference");
|
||||
}
|
||||
#endif
|
||||
else if (THIS->IsNPC()) {
|
||||
Log(Logs::Detail, Logs::None,
|
||||
"[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference");
|
||||
}
|
||||
#ifdef BOTS
|
||||
else if (THIS->IsBot()) {
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference");
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
Log(Logs::Detail, Logs::None,
|
||||
"[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference");
|
||||
@ -1283,15 +1285,17 @@ XS(XS_Client_MovePCInstance) {
|
||||
if (THIS->IsMerc()) {
|
||||
Log(Logs::Detail, Logs::None,
|
||||
"[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference");
|
||||
} else if (THIS->IsNPC()) {
|
||||
}
|
||||
#ifdef BOTS
|
||||
else if (THIS->IsBot()) {
|
||||
Log(Logs::Detail, Logs::None,
|
||||
"[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference");
|
||||
}
|
||||
#endif
|
||||
else if (THIS->IsNPC()) {
|
||||
Log(Logs::Detail, Logs::None,
|
||||
"[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference");
|
||||
}
|
||||
#ifdef BOTS
|
||||
else if (THIS->IsBot()) {
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference");
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
Log(Logs::Detail, Logs::None,
|
||||
"[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user