feat: check attackers user type

This commit is contained in:
Иванов Иван 2024-08-22 23:07:06 +02:00
parent 936697defc
commit e0ffa3a62e

View File

@ -104,7 +104,11 @@ namespace Interlude
{ {
if (m_Hero->GetId() == casted.GetTargetId()) if (m_Hero->GetId() == casted.GetTargetId())
{ {
m_Hero->AddAttacker(casted.GetAttackerId()); const auto attacker = m_NetworkHandler.GetUser(casted.GetAttackerId());
if (attacker && attacker->userType == L2::UserType::NPC)
{
m_Hero->AddAttacker(casted.GetAttackerId());
}
} }
else if (casted.GetAttackerId() != casted.GetTargetId()) else if (casted.GetAttackerId() != casted.GetTargetId())
{ {