From f43f0b9bd413894356f2efc0b62bd03c07b5824a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 29 Nov 2018 00:27:09 +0100 Subject: [PATCH] - added a few more direct native entry points. --- src/actorinlines.h | 4 +- src/p_acs.cpp | 2 +- src/p_actionfunctions.cpp | 6 +-- src/p_doors.cpp | 2 +- src/p_floor.cpp | 8 ++-- src/p_map.cpp | 6 +-- src/p_maputl.cpp | 4 +- src/p_plats.cpp | 2 +- src/p_sectors.cpp | 63 +++++++++++++++---------------- src/r_defs.h | 14 +++---- src/scripting/vmthunks.cpp | 29 +++++++------- wadsrc/static/zscript/mapdata.txt | 32 +++++++++++++++- 12 files changed, 97 insertions(+), 75 deletions(-) diff --git a/src/actorinlines.h b/src/actorinlines.h index 10c0ad615..8eb2f8e6f 100644 --- a/src/actorinlines.h +++ b/src/actorinlines.h @@ -46,11 +46,11 @@ inline double secplane_t::ZatPoint(const AActor *ac) const inline double sector_t::HighestCeilingAt(AActor *a, sector_t **resultsec) { - return HighestCeilingAt(a->Pos(), resultsec); + return ::HighestCeilingAt(this, a->X(), a->Y(), resultsec); } inline double sector_t::LowestFloorAt(AActor *a, sector_t **resultsec) { - return LowestFloorAt(a->Pos(), resultsec); + return ::LowestFloorAt(this, a->X(), a->Y(), resultsec); } diff --git a/src/p_acs.cpp b/src/p_acs.cpp index db65f0b70..4f45952f2 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4699,7 +4699,7 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b if (floor) { - actor->Sector->NextLowestFloorAt(actor->X(), actor->Y(), actor->Z(), 0, actor->MaxStepHeight, &resultsec, &resffloor); + NextLowestFloorAt(actor->Sector, actor->X(), actor->Y(), actor->Z(), 0, actor->MaxStepHeight, &resultsec, &resffloor); secpic = resffloor ? *resffloor->top.texture : resultsec->planes[sector_t::floor].Texture; } else diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 62726020e..2a835ccb7 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -578,7 +578,7 @@ DEFINE_ACTION_FUNCTION(AActor, GetZAt) } else if (flags & GZF_NO3DFLOOR) { - z = sec->HighestCeilingAt(pos); + z = HighestCeilingAt(sec, pos.X, pos.Y); } else { // [MC] Handle strict 3D floors and portal toggling via the flags passed to it. @@ -593,11 +593,11 @@ DEFINE_ACTION_FUNCTION(AActor, GetZAt) } else if (flags & GZF_NO3DFLOOR) { - z = sec->LowestFloorAt(pos); + z = LowestFloorAt(sec, pos.X, pos.Y); } else { - z = sec->NextLowestFloorAt(pos.X, pos.Y, mobj->Z(), pflags, mobj->MaxStepHeight); + z = NextLowestFloorAt(sec, pos.X, pos.Y, mobj->Z(), pflags, mobj->MaxStepHeight); } } } diff --git a/src/p_doors.cpp b/src/p_doors.cpp index be9b067af..f3c8abc0e 100644 --- a/src/p_doors.cpp +++ b/src/p_doors.cpp @@ -404,7 +404,7 @@ DDoor::DDoor (sector_t *sec, EVlDoor type, double speed, int delay, int lightTag } else { - height = sec->FindLowestCeilingPoint(&m_BotSpot); + height = FindLowestCeilingPoint(sec, &m_BotSpot); m_BotDist = sec->ceilingplane.PointToDist (m_BotSpot, height); } m_OldFloorDist = sec->floorplane.fD(); diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 305d75019..c10b5d82b 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -348,7 +348,7 @@ bool P_CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line, case DFloor::floorRaiseToLowestCeiling: floor->m_Direction = 1; newheight = sec->FindLowestCeilingSurrounding(&spot) - height; - ceilingheight = sec->FindLowestCeilingPoint(&spot2); + ceilingheight = FindLowestCeilingPoint(sec, &spot2); floor->m_FloorDestDist = sec->floorplane.PointToDist(spot, newheight); if (sec->floorplane.ZatPointDist(spot2, floor->m_FloorDestDist) > ceilingheight) floor->m_FloorDestDist = sec->floorplane.PointToDist(spot2, ceilingheight - height); @@ -374,13 +374,13 @@ bool P_CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line, case DFloor::floorRaiseAndCrush: floor->m_Direction = 1; - newheight = sec->FindLowestCeilingPoint(&spot) - 8; + newheight = FindLowestCeilingPoint(sec, &spot) - 8; floor->m_FloorDestDist = sec->floorplane.PointToDist(spot, newheight); break; case DFloor::floorRaiseToCeiling: floor->m_Direction = 1; - newheight = sec->FindLowestCeilingPoint(&spot) - height; + newheight = FindLowestCeilingPoint(sec, &spot) - height; floor->m_FloorDestDist = sec->floorplane.PointToDist(spot, newheight); break; @@ -399,7 +399,7 @@ bool P_CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line, case DFloor::floorLowerToCeiling: // [RH] Essentially instantly raises the floor to the ceiling floor->m_Direction = -1; - newheight = sec->FindLowestCeilingPoint(&spot) - height; + newheight = FindLowestCeilingPoint(sec, &spot) - height; floor->m_FloorDestDist = sec->floorplane.PointToDist(spot, newheight); break; diff --git a/src/p_map.cpp b/src/p_map.cpp index 8072e6e8f..7e5fbfb7f 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -323,7 +323,7 @@ void P_GetFloorCeilingZ(FCheckPosition &tmf, int flags) F3DFloor *ffc, *fff; tmf.ceilingz = NextHighestCeilingAt(sec, tmf.pos.X, tmf.pos.Y, tmf.pos.Z, tmf.pos.Z + tmf.thing->Height, flags, &tmf.ceilingsector, &ffc); - tmf.floorz = tmf.dropoffz = sec->NextLowestFloorAt(tmf.pos.X, tmf.pos.Y, tmf.pos.Z, flags, tmf.thing->MaxStepHeight, &tmf.floorsector, &fff); + tmf.floorz = tmf.dropoffz = NextLowestFloorAt(sec, tmf.pos.X, tmf.pos.Y, tmf.pos.Z, flags, tmf.thing->MaxStepHeight, &tmf.floorsector, &fff); if (fff) { @@ -1798,8 +1798,8 @@ bool P_CheckPosition(AActor *thing, const DVector2 &pos, FCheckPosition &tm, boo else { // With noclip2, we must ignore 3D floors and go right to the uppermost ceiling and lowermost floor. - tm.floorz = tm.dropoffz = newsec->LowestFloorAt(pos, &tm.floorsector); - tm.ceilingz = newsec->HighestCeilingAt(pos, &tm.ceilingsector); + tm.floorz = tm.dropoffz = LowestFloorAt(newsec, pos.X, pos.Y, &tm.floorsector); + tm.ceilingz = HighestCeilingAt(newsec, pos.X, pos.Y, &tm.ceilingsector); tm.floorpic = tm.floorsector->GetTexture(sector_t::floor); tm.floorterrain = tm.floorsector->GetTerrain(sector_t::floor); tm.ceilingpic = tm.ceilingsector->GetTexture(sector_t::ceiling); diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index 16aca4d86..13f6bc5d4 100644 --- a/src/p_maputl.cpp +++ b/src/p_maputl.cpp @@ -208,7 +208,7 @@ void P_LineOpening (FLineOpening &open, AActor *actor, const line_t *linedef, co { // We must check through the portal for the actual dropoff. // If there's no lines in the lower sections we'd never get a usable value otherwise. - open.lowfloor = back->NextLowestFloorAt(pos.X, pos.Y, back->GetPortalPlaneZ(sector_t::floor) - EQUAL_EPSILON); + open.lowfloor = NextLowestFloorAt(back, pos.X, pos.Y, back->GetPortalPlaneZ(sector_t::floor) - EQUAL_EPSILON); } } else @@ -222,7 +222,7 @@ void P_LineOpening (FLineOpening &open, AActor *actor, const line_t *linedef, co { // We must check through the portal for the actual dropoff. // If there's no lines in the lower sections we'd never get a usable value otherwise. - open.lowfloor = front->NextLowestFloorAt(pos.X, pos.Y, front->GetPortalPlaneZ(sector_t::floor) - EQUAL_EPSILON); + open.lowfloor = NextLowestFloorAt(front, pos.X, pos.Y, front->GetPortalPlaneZ(sector_t::floor) - EQUAL_EPSILON); } } open.frontfloorplane = front->floorplane; diff --git a/src/p_plats.cpp b/src/p_plats.cpp index e05363d41..41e7e6194 100644 --- a/src/p_plats.cpp +++ b/src/p_plats.cpp @@ -358,7 +358,7 @@ bool EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type, double height, plat->m_Crush = 10; //jff 3/14/98 crush anything in the way // set up toggling between ceiling, floor inclusive - newheight = sec->FindLowestCeilingPoint (&spot); + newheight = FindLowestCeilingPoint(sec, &spot); plat->m_Low = sec->floorplane.PointToDist (spot, newheight); plat->m_High = sec->floorplane.fD(); plat->m_Status = DPlat::down; diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index a4fdac5d1..c73b625f9 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -653,38 +653,38 @@ double sector_t::FindHighestFloorPoint (vertex_t **v) const // // Find the lowest point on the ceiling of the sector // -double sector_t::FindLowestCeilingPoint (vertex_t **v) const +double FindLowestCeilingPoint (const sector_t *sector, vertex_t **v) { double height = FLT_MAX; double probeheight; - vertex_t *spot = NULL; + vertex_t *spot = nullptr; - if (!ceilingplane.isSlope()) + if (!sector->ceilingplane.isSlope()) { - if (v != NULL) + if (v != nullptr) { - if (Lines.Size() == 0) *v = &level.vertexes[0]; - else *v = Lines[0]->v1; + if (sector->Lines.Size() == 0) *v = &level.vertexes[0]; + else *v = sector->Lines[0]->v1; } - return ceilingplane.fD(); + return sector->ceilingplane.fD(); } - for (auto line : Lines) + for (auto line : sector->Lines) { - probeheight = ceilingplane.ZatPoint(line->v1); + probeheight = sector->ceilingplane.ZatPoint(line->v1); if (probeheight < height) { height = probeheight; spot = line->v1; } - probeheight = ceilingplane.ZatPoint(line->v2); + probeheight = sector->ceilingplane.ZatPoint(line->v2); if (probeheight < height) { height = probeheight; spot = line->v2; } } - if (v != NULL) + if (v != nullptr) *v = spot; return height; } @@ -931,17 +931,16 @@ void CheckPortalPlane(sector_t *sector, int plane) // //=========================================================================== -double sector_t::HighestCeilingAt(const DVector2 &p, sector_t **resultsec) +double HighestCeilingAt(sector_t *check, double x, double y, sector_t **resultsec) { - sector_t *check = this; double planeheight = -FLT_MAX; - DVector2 pos = p; + DVector2 pos(x, y); // Continue until we find a blocking portal or a portal below where we actually are. - while (!check->PortalBlocksMovement(ceiling) && planeheight < check->GetPortalPlaneZ(ceiling)) + while (!check->PortalBlocksMovement(sector_t::ceiling) && planeheight < check->GetPortalPlaneZ(sector_t::ceiling)) { - pos += check->GetPortalDisplacement(ceiling); - planeheight = check->GetPortalPlaneZ(ceiling); + pos += check->GetPortalDisplacement(sector_t::ceiling); + planeheight = check->GetPortalPlaneZ(sector_t::ceiling); check = P_PointInSector(pos); } if (resultsec) *resultsec = check; @@ -954,17 +953,16 @@ double sector_t::HighestCeilingAt(const DVector2 &p, sector_t **resultsec) // //=========================================================================== -double sector_t::LowestFloorAt(const DVector2 &p, sector_t **resultsec) +double LowestFloorAt(sector_t *check, double x, double y, sector_t **resultsec) { - sector_t *check = this; double planeheight = FLT_MAX; - DVector2 pos = p; + DVector2 pos(x, y); // Continue until we find a blocking portal or a portal above where we actually are. - while (!check->PortalBlocksMovement(floor) && planeheight > check->GetPortalPlaneZ(floor)) + while (!check->PortalBlocksMovement(sector_t::floor) && planeheight > check->GetPortalPlaneZ(sector_t::floor)) { - pos += check->GetPortalDisplacement(floor); - planeheight = check->GetPortalPlaneZ(ceiling); + pos += check->GetPortalDisplacement(sector_t::floor); + planeheight = check->GetPortalPlaneZ(sector_t::ceiling); check = P_PointInSector(pos); } if (resultsec) *resultsec = check; @@ -1024,9 +1022,8 @@ double NextHighestCeilingAt(sector_t *sec, double x, double y, double bottomz, d // //===================================================================================== -double sector_t::NextLowestFloorAt(double x, double y, double z, int flags, double steph, sector_t **resultsec, F3DFloor **resultffloor) +double NextLowestFloorAt(sector_t *sec, double x, double y, double z, int flags, double steph, sector_t **resultsec, F3DFloor **resultffloor) { - sector_t *sec = this; double planeheight = FLT_MAX; while (true) { @@ -1052,7 +1049,7 @@ double sector_t::NextLowestFloorAt(double x, double y, double z, int flags, doub } } } - if ((flags & FFCF_NOPORTALS) || sec->PortalBlocksMovement(sector_t::floor) || planeheight <= sec->GetPortalPlaneZ(floor)) + if ((flags & FFCF_NOPORTALS) || sec->PortalBlocksMovement(sector_t::floor) || planeheight <= sec->GetPortalPlaneZ(sector_t::floor)) { // Use sector's floor if (resultffloor) *resultffloor = NULL; if (resultsec) *resultsec = sec; @@ -1060,10 +1057,10 @@ double sector_t::NextLowestFloorAt(double x, double y, double z, int flags, doub } else { - DVector2 pos = sec->GetPortalDisplacement(floor); + DVector2 pos = sec->GetPortalDisplacement(sector_t::floor); x += pos.X; y += pos.Y; - planeheight = sec->GetPortalPlaneZ(floor); + planeheight = sec->GetPortalPlaneZ(sector_t::floor); sec = P_PointInSector(x, y); } } @@ -1075,14 +1072,14 @@ double sector_t::NextLowestFloorAt(double x, double y, double z, int flags, doub // //=========================================================================== - double sector_t::GetFriction(int plane, double *pMoveFac) const +double GetFriction(const sector_t *self, int plane, double *pMoveFac) { - if (Flags & SECF_FRICTION) + if (self->Flags & SECF_FRICTION) { - if (pMoveFac) *pMoveFac = movefactor; - return friction; + if (pMoveFac) *pMoveFac = self->movefactor; + return self->friction; } - FTerrainDef *terrain = &Terrains[GetTerrain(plane)]; + FTerrainDef *terrain = &Terrains[self->GetTerrain(plane)]; if (terrain->Friction != 0) { if (pMoveFac) *pMoveFac = terrain->MoveFactor; diff --git a/src/r_defs.h b/src/r_defs.h index 64def3034..a7d6a112c 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -632,7 +632,6 @@ public: double FindNextHighestCeiling(vertex_t **v) const; // jff 2/04/98 int FindMinSurroundingLight (int max) const; sector_t *NextSpecialSector (int type, sector_t *prev) const; // [RH] - double FindLowestCeilingPoint(vertex_t **v) const; double FindHighestFloorPoint(vertex_t **v) const; void RemoveForceField(); int Index() const; @@ -961,10 +960,6 @@ public: void SetSpecial(const secspecial_t *spec); bool PlaneMoving(int pos); - // Portal-aware height calculation - double HighestCeilingAt(const DVector2 &a, sector_t **resultsec = NULL); - double LowestFloorAt(const DVector2 &a, sector_t **resultsec = NULL); - inline double HighestCeilingAt(AActor *a, sector_t **resultsec = NULL); inline double LowestFloorAt(AActor *a, sector_t **resultsec = NULL); @@ -973,8 +968,6 @@ public: return floorplane.Normal() == -ceilingplane.Normal() && floorplane.D == -ceilingplane.D; } - double NextLowestFloorAt(double x, double y, double z, int flags = 0, double steph = 0, sector_t **resultsec = NULL, F3DFloor **resultffloor = NULL); - // Member variables double CenterFloor() const { return floorplane.ZatPoint(centerspot); } double CenterCeiling() const { return ceilingplane.ZatPoint(centerspot); } @@ -1609,8 +1602,10 @@ double FindShortestTextureAround(sector_t *sector); // jff 2/04/98 double FindShortestUpperAround(sector_t *sector); // jff 2/04/98 sector_t *FindModelFloorSector(sector_t *sec, double floordestheight); // jff 2/04/98 sector_t *FindModelCeilingSector(sector_t *sec, double floordestheight); // jff 2/04/98 +double FindLowestCeilingPoint(const sector_t *sec, vertex_t **v); double NextHighestCeilingAt(sector_t *sec, double x, double y, double bottomz, double topz, int flags = 0, sector_t **resultsec = NULL, F3DFloor **resultffloor = NULL); +double NextLowestFloorAt(sector_t *sec, double x, double y, double z, int flags = 0, double steph = 0, sector_t **resultsec = NULL, F3DFloor **resultffloor = NULL); // This setup is to allow the VM call directily into the implementation. // With a member function this may be subject to OS implementation details, e.g. on Windows 32 bit members use a different calling convention than regular functions. @@ -1626,7 +1621,9 @@ void SetColor(sector_t *sector, int color, int desat); void SetFade(sector_t *sector, int color); int GetFloorLight(const sector_t *); int GetCeilingLight(const sector_t *); - +double GetFriction(const sector_t *self, int plane, double *movefac); +double HighestCeilingAt(sector_t *sec, double x, double y, sector_t **resultsec = nullptr); +double LowestFloorAt(sector_t *sec, double x, double y, sector_t **resultsec = nullptr); inline void sector_t::RemoveForceField() { return ::RemoveForceField(this); } inline bool sector_t::PlaneMoving(int pos) { return ::PlaneMoving(this, pos); } @@ -1640,6 +1637,7 @@ inline void sector_t::SetColor(PalEntry pe, int desat) { ::SetColor(this, pe, de inline void sector_t::SetFade(PalEntry pe) { ::SetFade(this, pe); } inline int sector_t::GetFloorLight() const { return ::GetFloorLight(this); } inline int sector_t::GetCeilingLight() const { return ::GetCeilingLight(this); } +inline double sector_t::GetFriction(int plane, double *movefac) const { return ::GetFriction(this, plane, movefac); } #endif diff --git a/src/scripting/vmthunks.cpp b/src/scripting/vmthunks.cpp index 9230f1792..5350b0709 100644 --- a/src/scripting/vmthunks.cpp +++ b/src/scripting/vmthunks.cpp @@ -127,34 +127,34 @@ DEFINE_ACTION_FUNCTION(_Sector, FindHighestFloorPoint) if (numret > 1) ret[1].SetPointer(v); return numret; } -DEFINE_ACTION_FUNCTION(_Sector, FindLowestCeilingPoint) +DEFINE_ACTION_FUNCTION_NATIVE(_Sector, FindLowestCeilingPoint, FindLowestCeilingPoint) { PARAM_SELF_STRUCT_PROLOGUE(sector_t); vertex_t *v; - double h = self->FindLowestCeilingPoint(&v); + double h = FindLowestCeilingPoint(self, &v); if (numret > 0) ret[0].SetFloat(h); if (numret > 1) ret[1].SetPointer(v); return numret; } -DEFINE_ACTION_FUNCTION(_Sector, HighestCeilingAt) +DEFINE_ACTION_FUNCTION_NATIVE(_Sector, HighestCeilingAt, HighestCeilingAt) { PARAM_SELF_STRUCT_PROLOGUE(sector_t); PARAM_FLOAT(x); PARAM_FLOAT(y); sector_t *s; - double h = self->HighestCeilingAt(DVector2(x, y), &s); + double h = HighestCeilingAt(self, x, y, &s); if (numret > 0) ret[0].SetFloat(h); if (numret > 1) ret[1].SetPointer(s); return numret; } -DEFINE_ACTION_FUNCTION(_Sector, LowestFloorAt) +DEFINE_ACTION_FUNCTION_NATIVE(_Sector, LowestFloorAt, LowestFloorAt) { PARAM_SELF_STRUCT_PROLOGUE(sector_t); PARAM_FLOAT(x); PARAM_FLOAT(y); sector_t *s; - double h = self->LowestFloorAt(DVector2(x, y), &s); + double h = LowestFloorAt(self, x, y, &s); if (numret > 0) ret[0].SetFloat(h); if (numret > 1) ret[1].SetPointer(s); return numret; @@ -177,7 +177,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, NextHighestCeilingAt, NextHighestCeilingA if (numret > 0) ret[0].SetFloat(resultheight); return numret; } -DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt) +DEFINE_ACTION_FUNCTION_NATIVE(_Sector, NextLowestFloorAt, NextLowestFloorAt) { PARAM_SELF_STRUCT_PROLOGUE(sector_t); PARAM_FLOAT(x); @@ -187,7 +187,7 @@ DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt) PARAM_FLOAT(steph); sector_t *resultsec; F3DFloor *resultff; - double resultheight = self->NextLowestFloorAt(x, y, z, flags, steph, &resultsec, &resultff); + double resultheight = NextLowestFloorAt(self, x, y, z, flags, steph, &resultsec, &resultff); if (numret > 2) ret[2].SetPointer(resultff); if (numret > 1) ret[1].SetPointer(resultsec); @@ -195,7 +195,7 @@ DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt) return numret; } -DEFINE_ACTION_FUNCTION(_Sector, GetFriction) +DEFINE_ACTION_FUNCTION_NATIVE(_Sector, GetFriction, GetFriction) { PARAM_SELF_STRUCT_PROLOGUE(sector_t); PARAM_INT(plane); @@ -205,15 +205,14 @@ DEFINE_ACTION_FUNCTION(_Sector, GetFriction) if (numret > 1) ret[1].SetFloat(mf); return numret; } -DEFINE_ACTION_FUNCTION(_Sector, TriggerSectorActions) + + +static void GetPortalDisplacement(sector_t *sec, int plane, DVector2 *result) { - PARAM_SELF_STRUCT_PROLOGUE(sector_t); - PARAM_OBJECT(thing, AActor); - PARAM_INT(activation); - ACTION_RETURN_BOOL(self->TriggerSectorActions(thing, activation)); + *result = sec->GetPortalDisplacement(plane); } -DEFINE_ACTION_FUNCTION(_Sector, GetPortalDisplacement) +DEFINE_ACTION_FUNCTION_NATIVE(_Sector, GetPortalDisplacement, GetPortalDisplacement) { PARAM_SELF_STRUCT_PROLOGUE(sector_t); PARAM_INT(pos); diff --git a/wadsrc/static/zscript/mapdata.txt b/wadsrc/static/zscript/mapdata.txt index 3e931e436..4db3a765d 100644 --- a/wadsrc/static/zscript/mapdata.txt +++ b/wadsrc/static/zscript/mapdata.txt @@ -431,7 +431,6 @@ struct Sector native play native int GetOppositePortalGroup(int plane); native double CenterFloor(); native double CenterCeiling(); - native bool TriggerSectorActions(Actor thing, int activation); native int MoveFloor(double speed, double dest, int crush, int direction, bool hexencrush, bool instant = false); native int MoveCeiling(double speed, double dest, int crush, int direction, bool hexencrush); @@ -490,7 +489,36 @@ struct Sector native play { return Level.GetUDMFString(LevelLocals.UDMF_Sector, Index(), nm); } - + + //=========================================================================== + // + // + // + //=========================================================================== + + bool TriggerSectorActions(Actor thing, int activation) + { + let act = SecActTarget; + bool res = false; + + while (act != null) + { + Actor next = act.tracer; + + if (act.TriggerAction(thing, activation)) + { + if (act.bStandStill) + { + act.Destroy(); + } + res = true; + } + act = SectorAction(next); + } + return res; + } + + native clearscope int GetHealth(SectorPart part); native void SetHealth(SectorPart part, int newhealth); }