Skip to content

Commit ecdfe39

Browse files
inkoalawetrustmadame-rachelle
authored andcommitted
Exposed DElevator to ZScript.
1 parent f0d0f25 commit ecdfe39

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

src/playsim/mapthinkers/a_floor.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,12 @@ void DElevator::Serialize(FSerializer &arc)
903903
("interp_ceiling", m_Interp_Ceiling);
904904
}
905905

906+
DEFINE_FIELD(DElevator, m_Type)
907+
DEFINE_FIELD(DElevator, m_Direction)
908+
DEFINE_FIELD(DElevator, m_FloorDestDist)
909+
DEFINE_FIELD(DElevator, m_CeilingDestDist)
910+
DEFINE_FIELD(DElevator, m_Speed)
911+
906912
//==========================================================================
907913
//
908914
//
@@ -973,7 +979,7 @@ void DElevator::Tick ()
973979
}
974980
}
975981

976-
if (res == EMoveResult::pastdest) // if destination height acheived
982+
if (res == EMoveResult::pastdest) // if destination height achieved
977983
{
978984
// make floor stop sound
979985
SN_StopSequence (m_Sector, CHAN_FLOOR);

src/playsim/mapthinkers/a_floor.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,20 @@ class DElevator : public DMover
105105
elevateLower
106106
};
107107

108+
EElevator m_Type;
109+
int m_Direction;
110+
double m_FloorDestDist;
111+
double m_CeilingDestDist;
112+
double m_Speed;
113+
114+
108115
void Construct(sector_t *sec);
109116

110117
void OnDestroy() override;
111118
void Serialize(FSerializer &arc);
112119
void Tick ();
113120

114121
protected:
115-
EElevator m_Type;
116-
int m_Direction;
117-
double m_FloorDestDist;
118-
double m_CeilingDestDist;
119-
double m_Speed;
120122
TObjPtr<DInterpolation*> m_Interp_Ceiling;
121123
TObjPtr<DInterpolation*> m_Interp_Floor;
122124

wadsrc/static/zscript/doombase.zs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,25 @@ class SectorEffect : Thinker native
643643
class Mover : SectorEffect native
644644
{}
645645

646+
class Elevator : Mover native
647+
{
648+
enum EElevator
649+
{
650+
elevateUp,
651+
elevateDown,
652+
elevateCurrent,
653+
// [RH] For FloorAndCeiling_Raise/Lower
654+
elevateRaise,
655+
elevateLower
656+
};
657+
658+
native readonly EElevator m_Type;
659+
native readonly int m_Direction;
660+
native readonly double m_FloorDestDist;
661+
native readonly double m_CeilingDestDist;
662+
native readonly double m_Speed;
663+
}
664+
646665
class MovingFloor : Mover native
647666
{}
648667

0 commit comments

Comments
 (0)