Skip to content

Commit

Permalink
knockback elemental arrow bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
wkdgmr committed Oct 7, 2023
1 parent 68369a0 commit b3c1cc4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Source/missiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,14 @@ void CheckMissileCol(Missile &missile, DamageType damageType, int minDamage, int
if (!dontDeleteOnCollision)
missile._mirange = 0;
missile._miHitFlag = true;
if (missile._mitype == MissileID::FireArrow
|| missile._mitype == MissileID::LightningArrow) {
Point c = missile.position.tile;
auto *monster = FindClosest(c, 1);
if (monster != nullptr) {
missile.position.tile = monster->position.tile;
}
}
}

bool isPlayerHit = false;
Expand Down Expand Up @@ -3134,14 +3142,6 @@ void ProcessElementalArrow(Missile &missile)
}
}
if (missile._mirange == 0) {
if (missile._mitype == MissileID::FireArrow
|| missile._mitype == MissileID::LightningArrow) {
Point c = missile.position.tile;
auto *monster = FindClosest(c, 1);
if (monster != nullptr) {
missile.position.tile = monster->position.tile;
}
}
missile._miDelFlag = true;
AddUnLight(missile._mlid);
}
Expand Down

0 comments on commit b3c1cc4

Please sign in to comment.