Thanks, I had some free time this weekend, so I finished the whole "throwing items" feature. Only thing still missing is an out of range check.
I implemented throwing to make it feel like the old x-com as much as I could, and improve a little where I could.
The soldier throws in a parabolic trajectory, but depending on the obstacles it chooses the best curvature (or how high the arc is in the middle point).
Openxcom will test 4 curvatures, going from almost straight, which is good when there are no obstacles, to very curved when you want to throw something over a fence or a wall. When you are indoors the bigger curvings will fail, because the arc hits the ceiling.
After the curvature is determined, it will apply a deviation on the two angles (tilt & pan) at which the trajectory starts (using normal distributed number between 0 and max deviation, which depends on the soldiers throwing accuracy (>=100% accuracy will result in a minimum deviation)).
This will result (as with firing) in a range-based accuracy. A very small deviation on a short distance is no issue, but a small deviation in a throwing angle for a long range throw can cause the item to end up one or more tiles off-target.
I remember it was painful when you wanted to throw a live grenade through a window, but you missed and it would hit the wall