1
0
forked from xjboss/KCauldronX

Fix crash with indirect damage when indirect entity == null, for example

thrower is not entity.

Fix #361
This commit is contained in:
Sergey Shatunov 2016-02-11 12:45:35 +07:00
parent cdc6bcae21
commit 7eba5f9dee

View File

@ -5,7 +5,7 @@
super(p_i1568_1_, p_i1568_2_);
this.indirectEntity = p_i1568_3_;
+ // KCauldron start - pass projectlie source
+ if (damageSourceEntity != null && damageSourceEntity.getBukkitEntity() instanceof org.bukkit.entity.Projectile && indirectEntity.getBukkitEntity() instanceof org.bukkit.projectiles.ProjectileSource)
+ if (damageSourceEntity != null && damageSourceEntity.getBukkitEntity() instanceof org.bukkit.entity.Projectile && indirectEntity != null && indirectEntity.getBukkitEntity() instanceof org.bukkit.projectiles.ProjectileSource)
+ ((org.bukkit.entity.Projectile) damageSourceEntity.getBukkitEntity()).setShooter((org.bukkit.projectiles.ProjectileSource) indirectEntity.getBukkitEntity());
+ // KCauldron end
}