Safeguard against InPlayerFOV being called with no camera.

This commit is contained in:
Mari the Deer 2021-06-24 19:20:24 +02:00
commit cfc3c0f7af
2 changed files with 4 additions and 2 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r555 \cu(Wed 23 Jun 01:06:21 CEST 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r555 \cu(2021-06-23 01:06:21)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r556 \cu(Thu 24 Jun 19:20:48 CEST 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r556 \cu(2021-06-24 19:20:48)\c-";

View file

@ -1113,6 +1113,7 @@ Class SWWMUtility
double vfov = p.fov*.5;
double hfov = atan(Screen.GetAspectRatio()*tan(vfov));
let mo = p.camera;
if ( !mo ) return false;
Vector3 pp;
if ( !mo.CheckSight(a,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) return false;
if ( mo is 'PlayerPawn' ) pp = mo.Vec2OffsetZ(0,0,PlayerPawn(mo).player.viewz);
@ -1129,6 +1130,7 @@ Class SWWMUtility
double vfov = p.fov*.5;
double hfov = atan(Screen.GetAspectRatio()*tan(vfov));
let mo = p.camera;
if ( !mo ) return false;
Vector3 pp;
if ( mo is 'PlayerPawn' ) pp = mo.Vec2OffsetZ(0,0,PlayerPawn(mo).player.viewz);
else pp = mo.Vec3Offset(0,0,mo.CameraHeight);