mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +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
|
#ifdef BOTS
|
||||||
|
// this is HIGHLY inefficient
|
||||||
bool HasRuleDefined = false;
|
bool HasRuleDefined = false;
|
||||||
bool IsBotAttackAllowed = false;
|
bool IsBotAttackAllowed = false;
|
||||||
IsBotAttackAllowed = Bot::IsBotAttackAllowed(mob1, mob2, HasRuleDefined);
|
IsBotAttackAllowed = Bot::IsBotAttackAllowed(mob1, mob2, HasRuleDefined);
|
||||||
|
|||||||
@ -286,6 +286,17 @@ Bot *Entity::CastToBot()
|
|||||||
#endif
|
#endif
|
||||||
return static_cast<Bot *>(this);
|
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
|
#endif
|
||||||
|
|
||||||
EntityList::EntityList()
|
EntityList::EntityList()
|
||||||
|
|||||||
@ -116,6 +116,7 @@ public:
|
|||||||
|
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
Bot* CastToBot();
|
Bot* CastToBot();
|
||||||
|
const Bot* CastToBot() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -1233,15 +1233,17 @@ XS(XS_Client_MovePC) {
|
|||||||
if (THIS->IsMerc()) {
|
if (THIS->IsMerc()) {
|
||||||
Log(Logs::Detail, Logs::None,
|
Log(Logs::Detail, Logs::None,
|
||||||
"[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference");
|
"[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,
|
Log(Logs::Detail, Logs::None,
|
||||||
"[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference");
|
"[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 {
|
else {
|
||||||
Log(Logs::Detail, Logs::None,
|
Log(Logs::Detail, Logs::None,
|
||||||
"[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference");
|
"[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference");
|
||||||
@ -1283,15 +1285,17 @@ XS(XS_Client_MovePCInstance) {
|
|||||||
if (THIS->IsMerc()) {
|
if (THIS->IsMerc()) {
|
||||||
Log(Logs::Detail, Logs::None,
|
Log(Logs::Detail, Logs::None,
|
||||||
"[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference");
|
"[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,
|
Log(Logs::Detail, Logs::None,
|
||||||
"[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference");
|
"[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 {
|
else {
|
||||||
Log(Logs::Detail, Logs::None,
|
Log(Logs::Detail, Logs::None,
|
||||||
"[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference");
|
"[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user