From 7559ccc1360b99edf09472e948b0fdf9b23a5d47 Mon Sep 17 00:00:00 2001 From: thokkat Date: Thu, 9 Mar 2023 20:09:27 +0000 Subject: [PATCH] Prevent ranged damage from hitting twice (#424) * prevent ranged damage from hitting twice --------- Co-authored-by: Try --- game/world/bullet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/game/world/bullet.cpp b/game/world/bullet.cpp index 1fbc16deb..9c2b8b126 100644 --- a/game/world/bullet.cpp +++ b/game/world/bullet.cpp @@ -115,6 +115,8 @@ void Bullet::onMove() { } void Bullet::onCollide(phoenix::material_group matId) { + if(isFinished()) + return; if(matId != phoenix::material_group::none) { if(material < ItemMaterial::MAT_COUNT) { auto s = wrld->addLandHitEffect(ItemMaterial(material),matId,obj->matrix()); @@ -130,7 +132,7 @@ void Bullet::onCollide(phoenix::material_group matId) { } void Bullet::onCollide(Npc& npc) { - if(&npc==origin()) + if(&npc==origin() || isFinished()) return; if(ow!=nullptr) {