ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.73k stars 377 forks source link

Chain Lighting spell sequence problem #537

Closed Branikolog closed 3 years ago

Branikolog commented 4 years ago

Chain Lighting spell hits units with improper sequence. Chain Chain2 On the screenshot I hit 3rd unit with the spell. Then it goes to 2nd unit. After 4th and then 1st.

idshibanov commented 4 years ago

In OG spell jumps to closest target (use unit.GetRectPosition). If there's multiple then it's random.

Branikolog commented 4 years ago

I don't know exactly how it works in the OG, but in heroes3 and logically Chain Lighting spell should hit the nearest unit to the unit it stroke before. Now it seems to check closest units to the first target and hit them in order considered their location compared to the first target unit.

Branikolog commented 4 years ago

Also "chain lighting" spell hits twice 2-hex unit, if player targets farthest hex of creature. Chain