Fix a div by zero in polymost_internal_nonparallaxed.

git-svn-id: https://svn.eduke32.com/eduke32@2758 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-06-13 23:13:31 +00:00
parent 8d8196993b
commit 4353170b47

View file

@ -3205,7 +3205,9 @@ static void polymost_internal_nonparallaxed(double nx0, double ny0, double nx1,
}
gdx = 0;
gdy = gxyaspect;
if (!(globalorientation&2)) gdy /= (double)(global_cf_z-globalposz);
if (!(globalorientation&2))
if (global_cf_z-globalposz) // PK 2012: don't allow div by zero
gdy /= (double)(global_cf_z-globalposz);
gdo = -ghoriz*gdy;
if (globalorientation&8) { ft[0] /= 8; ft[1] /= -8; ft[2] /= 2097152; ft[3] /= 2097152; }
else { ft[0] /= 16; ft[1] /= -16; ft[2] /= 4194304; ft[3] /= 4194304; }