despawn projectile instead of weird movement

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