Don't store secplanes directly on biogel, fixes inability to save since secplanes can't be serialized.

This commit is contained in:
Marisa the Magician 2018-06-12 14:08:03 +02:00
commit a1ad5a7463

View file

@ -184,7 +184,8 @@ Class BioGel : Actor
Line atline; Line atline;
int atside; int atside;
int atpart; int atpart;
secplane atplane; int atplane;
Sector atsector;
double atz; double atz;
int rollvel, pitchvel, yawvel; int rollvel, pitchvel, yawvel;
Vector3 normal; Vector3 normal;
@ -243,9 +244,9 @@ Class BioGel : Actor
else SetOrigin(Vec2OffsetZ(0,0,atz+atline.sidedef[atside].sector.GetPlaneTexZ(1)),true); else SetOrigin(Vec2OffsetZ(0,0,atz+atline.sidedef[atside].sector.GetPlaneTexZ(1)),true);
if ( (pos.z > ceilingz) || (pos.z < floorz) ) deadtimer = min(deadtimer,0); if ( (pos.z > ceilingz) || (pos.z < floorz) ) deadtimer = min(deadtimer,0);
} }
else if ( atplane ) // attempt to follow the movement of the plane else if ( atsector ) // attempt to follow the movement of the plane
{ {
SetOrigin(Vec2OffsetZ(0,0,atz+cursector.GetPlaneTexZ(atpart)),true); SetOrigin(Vec2OffsetZ(0,0,atz+cursector.GetPlaneTexZ(atplane)),true);
if ( ceilingz-floorz <= 2 ) deadtimer = min(deadtimer,0); if ( ceilingz-floorz <= 2 ) deadtimer = min(deadtimer,0);
} }
} }
@ -322,8 +323,8 @@ Class BioGel : Actor
} }
else if ( pos.z <= floorz+4 ) else if ( pos.z <= floorz+4 )
{ {
atplane = cursector.floorplane; atsector = cursector;
atpart = 0; atplane = 0;
normal = cursector.floorplane.Normal; normal = cursector.floorplane.Normal;
pitch = asin(-normal.z); pitch = asin(-normal.z);
angle = atan2(normal.y,normal.x); angle = atan2(normal.y,normal.x);
@ -334,8 +335,8 @@ Class BioGel : Actor
} }
else if ( pos.z >= ceilingz-8 ) else if ( pos.z >= ceilingz-8 )
{ {
atplane = cursector.ceilingplane; atsector = cursector;
atpart = 1; atplane = 1;
normal = cursector.ceilingplane.Normal; normal = cursector.ceilingplane.Normal;
pitch = asin(-normal.z); pitch = asin(-normal.z);
angle = atan2(normal.y,normal.x); angle = atan2(normal.y,normal.x);