Skip to content

Commit

Permalink
Prevent ranged damage from hitting twice (#424)
Browse files Browse the repository at this point in the history
* prevent ranged damage from hitting twice

---------

Co-authored-by: Try <try9998@gmail.com>
  • Loading branch information
thokkat and Try authored Mar 9, 2023
1 parent 7f5ce7a commit 7559ccc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion game/world/bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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) {
Expand Down

0 comments on commit 7559ccc

Please sign in to comment.