Fixed, Visual mode, DB2 bug: Visual Camera Thing's (32000) vertical position was always set to -41 when switching from Visual mode if the camera was not inside a sector.

This commit is contained in:
MaxED 2015-10-26 19:58:38 +00:00
parent 19c84692ad
commit 958bc4de47

View file

@ -117,8 +117,7 @@ namespace CodeImp.DoomBuilder.VisualModes
{
modething.DetermineSector();
float z = modething.Position.z;
if(modething.Sector != null)
z = modething.Position.z + modething.Sector.FloorHeight;
if(modething.Sector != null) z += modething.Sector.FloorHeight;
// Position camera here
Vector3D wantedposition = new Vector3D(modething.Position.x, modething.Position.y, z + THING_Z_OFFSET);
@ -158,8 +157,8 @@ namespace CodeImp.DoomBuilder.VisualModes
// Found one?
if(modething != null)
{
int z = 0;
if(sector != null) z = (int)position.z - sector.FloorHeight;
int z = (int)position.z; //mxd
if(sector != null) z -= sector.FloorHeight;
// Position the thing to match camera
modething.Move((int)position.x, (int)position.y, z - THING_Z_OFFSET);