Skip to content

Commit

Permalink
Fixed that players with PvP OFF couldn't attack owned entities
Browse files Browse the repository at this point in the history
PR #252
  • Loading branch information
CraftedMods committed Sep 8, 2018
1 parent 424140c commit 62b9be4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#### Bug fixes:
* Fixed a crash with some ownable entities
* Fixed that players with PvP disabled couldn't attack themselves or their owned entities

### LOTR compatibility:
* Updated to Beta 34.1 of the LOTR Mod
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/pvpmode/PvPEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void interceptPvP (LivingAttackEvent event)
EntityPlayerMP attacker = PvPUtils.getMaster (event.source.getEntity ());
EntityPlayerMP victim = PvPUtils.getMaster (event.entity);

if (attacker == null || victim == null)
if (attacker == null || victim == null || attacker == victim)
return;

EnumPvPMode attackerMode = PvPUtils.getPvPMode (attacker);
Expand Down

0 comments on commit 62b9be4

Please sign in to comment.