From a1ad5a746380defbeef32774aa7bbb26d0836104 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Tue, 12 Jun 2018 14:08:03 +0200 Subject: [PATCH] Don't store secplanes directly on biogel, fixes inability to save since secplanes can't be serialized. --- zscript/biorifle.zsc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/zscript/biorifle.zsc b/zscript/biorifle.zsc index e916f49..a1efc22 100644 --- a/zscript/biorifle.zsc +++ b/zscript/biorifle.zsc @@ -184,7 +184,8 @@ Class BioGel : Actor Line atline; int atside; int atpart; - secplane atplane; + int atplane; + Sector atsector; double atz; int rollvel, pitchvel, yawvel; Vector3 normal; @@ -243,9 +244,9 @@ Class BioGel : Actor else SetOrigin(Vec2OffsetZ(0,0,atz+atline.sidedef[atside].sector.GetPlaneTexZ(1)),true); 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); } } @@ -322,8 +323,8 @@ Class BioGel : Actor } else if ( pos.z <= floorz+4 ) { - atplane = cursector.floorplane; - atpart = 0; + atsector = cursector; + atplane = 0; normal = cursector.floorplane.Normal; pitch = asin(-normal.z); angle = atan2(normal.y,normal.x); @@ -334,8 +335,8 @@ Class BioGel : Actor } else if ( pos.z >= ceilingz-8 ) { - atplane = cursector.ceilingplane; - atpart = 1; + atsector = cursector; + atplane = 1; normal = cursector.ceilingplane.Normal; pitch = asin(-normal.z); angle = atan2(normal.y,normal.x);