Fixed catapult spell constantly refiring when cast using the regular cast spell ability instead of shoot spell

This commit is contained in:
Sollace 2023-05-29 12:27:43 +01:00
parent f3d251c1d0
commit a8e5c50e9b
3 changed files with 4 additions and 3 deletions

View file

@ -59,7 +59,8 @@ public class CatapultSpell extends AbstractSpell implements ProjectileDelegate.B
} }
getTypeAndTraits().create().toThrowable().throwProjectile(caster); getTypeAndTraits().create().toThrowable().throwProjectile(caster);
return false; setDead();
return isDead();
} }
protected void apply(Caster<?> caster, Entity e) { protected void apply(Caster<?> caster, Entity e) {

View file

@ -23,7 +23,7 @@ public class ChillingBreathSpell extends AbstractSpell implements HomingSpell {
if (!source.subtractEnergyCost(90)) { if (!source.subtractEnergyCost(90)) {
setDead(); setDead();
} }
return false; return !isDead();
} }
@Override @Override

View file

@ -170,7 +170,7 @@ public class MagicProjectileEntity extends ThrownItemEntity implements Caster<Ma
@Override @Override
public void tick() { public void tick() {
if (!world.isClient() && !homingTarget.isPresent(world)) { if (!world.isClient() && !homingTarget.isPresent(world)) {
if (getVelocity().length() < 0.01) { if (getVelocity().length() < 0.1 || age > 90) {
discard(); discard();
} }
} }