EchoLiao / hedgewars

Automatically exported from code.google.com/p/hedgewars
GNU General Public License v2.0
0 stars 0 forks source link

Bad sniper line of sight and sniper shots when hedgehog stands on top of the map #827

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This bug report is concerning a weird behaviour of the sniper rifle when your 
hedgehog stands on the topmost position of the map.

What steps will reproduce the problem?
1. Create any map which has land at the very top (you can for example draw such 
a map)
2. Get any hog on the topmost possible position
3. Aim and shoot a sniper rifle several times towards the land. Do this in 
several directions.

Expected outcome:
1. The line of sight is blocked by the landmass
2. The sniper shot hits the landmass

Actual outcome:
1. In particular angles, the sniper line of sight goes through the landmass
2. Sometimes the sniper shot does not destroy any landscape, although it 
clearly should have hit it
3. Rarely your hedgehog somehow manages to shoot itself! lol

Tested in: Hedgewars 0.9.20 on GNU/Linux.

I have uploaded a demo which demonstrates this bug in 0.9.20. Here you can 
download it:
http://www.hedgewars.org/files/demos/Wuzzy/Top_Sniper_Bug.47.hwd

Original issue reported on code.google.com by almikes@aol.com on 23 Nov 2014 at 3:14

GoogleCodeExporter commented 9 years ago
Thanks for reporting. Nice find!

The reason for this bug is probably that the shot/laser is fired from outside 
the land collision array and that it then the following wrongly assumed:
"the land collision area was left, so there is nothing else to do" -
without even considering that the bullet/laser could be moving /towards/ the 
land array, rather than away.

Original comment by sheepyluva on 27 Nov 2014 at 8:28