Originally posted by Goober5000
...
Okay, so why is it different? Is this the same thing as Bobboau's fire-through-hull fix? That better not have been added back in again...
If the turret fov is 0, though, that's rather odd. Can you checkout the CVS from 3.6.5 and step through that code?
actually the true fov is cos-1(0)=90, so that fits.
results
365
=============================
- aim_dir {...}
- xyz {...}
x -0.00291909
y -0.0317455
z -0.999492
+ a1d 0x0012b85c
- turret_dir {...}
- xyz {...}
x 0.00158776
y 0.286144
z -0.958185
+ a1d 0x0012b880
vm_vec_dotprod(aim_dir, turret_dir) = .94
.94 > 0 so beam fires
current codebase
===================
- aim_dir {...}
- xyz {...}
x -0.0110746
y -0.0243270
z -0.999643
+ a1d 0x0012b86c
- turret_dir {...}
- xyz {...}
x -0.0441259
y 0.957293
z 0.285733
+ a1d 0x0012b890
vm_vec_dotprod(&aim_dir, &turret_dir) -0.308430
-.3 < 0 so beam doesn't fire.
turret_dir is waaaay off. The only thing that modifies it in beam_ok_to_fire() is beam_get_global_turret_gun_info(), which calls ship_get_global_turret_gun_info(), which then calls:
ship_model_start()
model_find_world_point()
model_find_world_dir()
vm_vec_normalized_dir()
ship_model_stop()
if any of those have been modified since then, thats probably your culprit. of those i can easily rule out vm_vec_normalize_dir() since thats far more wide reaching. model_find_world_point()/dir() also seem to be unlikely to cause this.
i also did some CVS checkouts by date, March 1st was ok. April 1st wasn't
edit5: hey i think i found it
http://fs2source.warpcore.org/cgi-bin/cvsweb/cvsweb.cgi/fs2_open/code/model/modelread.cpp.diff?r1=2.58&r2=2.59&f=hprobably explains why turret_dir in the old code had the y&z components swapped and negated
edit6: yea that worked. thats too much work for a 2 line bug