despawn projectile instead of weird movement

This commit is contained in:
2025-01-17 14:46:27 +09:00
parent 1a5e811020
commit a44693aa5d
+1 -4
View File
@@ -37,11 +37,8 @@ export default class Ability {
effect: function straightShotEffect(caster, cursor) { effect: function straightShotEffect(caster, cursor) {
const ability = this const ability = this
const straightShotCollision = function straightShotCollision(projectile, collidingEntity) { const straightShotCollision = function straightShotCollision(projectile, collidingEntity) {
if (!projectile.memory.hit) {
collidingEntity.damage(ability.damage) collidingEntity.damage(ability.damage)
projectile.memory.hit = true projectile.despawn()
projectile.destination = collidingEntity.position.clone()
}
} }
const projectile = new Projectile({ const projectile = new Projectile({