mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 15:57:13 +00:00
fix: a player with PVP on is not its own enemy
LWOCharacterComponent::SendMessage (0x00d34330), IsValidPVPTarget: the target is never the player itself. LWODestroyableComponent's IsEnemy asks it for every character. DLU called a player with PVP on an enemy of itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -532,6 +532,8 @@ void DestroyableComponent::AddFaction(const int32_t factionID, const bool ignore
|
||||
bool DestroyableComponent::IsEnemy(const Entity* other) const {
|
||||
if (IsEnemyImplentation.ExecuteWithDefault(other, false)) return true;
|
||||
if (m_Parent->IsPlayer() && other->IsPlayer()) {
|
||||
// A player is never its own PVP target
|
||||
if (other == m_Parent) return false;
|
||||
auto* thisCharacterComponent = m_Parent->GetComponent<CharacterComponent>();
|
||||
if (!thisCharacterComponent) return false;
|
||||
auto* otherCharacterComponent = other->GetComponent<CharacterComponent>();
|
||||
|
||||
Reference in New Issue
Block a user