Skip to content

Commit

Permalink
🐛 Fixed NPE with "kill mobs" stage type
Browse files Browse the repository at this point in the history
  • Loading branch information
SkytAsul committed Apr 4, 2023
1 parent 667109b commit 4efaf6e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/java/fr/skytasul/quests/stages/StageMobs.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ public void setShoot(boolean shoot) {

@EventHandler
public void onMobKilled(CompatMobDeathEvent e){
if (shoot && e.getBukkitEntity() != null && e.getBukkitEntity().getLastDamageCause().getCause() != DamageCause.PROJECTILE) return;
if (shoot && e.getBukkitEntity() != null && e.getBukkitEntity().getLastDamageCause() != null
&& e.getBukkitEntity().getLastDamageCause().getCause() != DamageCause.PROJECTILE)
return;

Player p = e.getKiller();
if (p == e.getBukkitEntity()) return; // player suicidal
PlayerAccount acc = PlayersManager.getPlayerAccount(p);
Expand Down

0 comments on commit 4efaf6e

Please sign in to comment.