[Cleanup] Cleanup Body Type Code (#4366)

* [Cleanup] Cleanup Body Type-based Code

* Update bodytypes.cpp

* Final

* Update body_type.cpp

* Cleanup

* Cleanup

* Formatting

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Alex King
2024-06-02 04:25:06 -04:00
committed by GitHub
parent 0c45d3b09e
commit 8640776a21
39 changed files with 324 additions and 250 deletions
+7 -7
View File
@@ -11882,8 +11882,8 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
}
else if (victim->IsNPC()) {
auto body = victim->GetBodyType();
if (body == BT_Humanoid || body == BT_Monster || body == BT_Giant ||
body == BT_Lycanthrope) {
if (body == BodyType::Humanoid || body == BodyType::Monster || body == BodyType::Giant ||
body == BodyType::Lycanthrope) {
victim->CastToNPC()->PickPocket(this);
return;
}
@@ -14999,9 +14999,9 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
if (nt) {
if (GetGM() || (!nt->IsInvisible(this) && (DistanceSquared(m_Position, nt->GetPosition()) <= TARGETING_RANGE*TARGETING_RANGE))) {
if (nt->GetBodyType() == BT_NoTarget2 ||
nt->GetBodyType() == BT_Special ||
nt->GetBodyType() == BT_NoTarget) {
if (nt->GetBodyType() == BodyType::NoTarget2 ||
nt->GetBodyType() == BodyType::Special ||
nt->GetBodyType() == BodyType::NoTarget) {
can_target = false;
}
else {
@@ -15144,8 +15144,8 @@ void Client::Handle_OP_TargetMouse(const EQApplicationPacket *app)
GetTarget()->IsTargeted(1);
return;
}
else if (GetTarget()->GetBodyType() == BT_NoTarget2 || GetTarget()->GetBodyType() == BT_Special
|| GetTarget()->GetBodyType() == BT_NoTarget)
else if (GetTarget()->GetBodyType() == BodyType::NoTarget2 || GetTarget()->GetBodyType() == BodyType::Special
|| GetTarget()->GetBodyType() == BodyType::NoTarget)
{
auto message = fmt::format(
"[{}] attempting to target something untargetable [{}] bodytype [{}]",