diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 67215cf41..c170cacd3 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -519,19 +519,19 @@ FUNC(LS_Generic_Stairs) FUNC(LS_Pillar_Build) // Pillar_Build (tag, speed, height) { - return EV_DoPillar (DPillar::pillarBuild, arg0, SPEED(arg1), arg2*FRACUNIT, 0, -1, false); + return EV_DoPillar (DPillar::pillarBuild, ln, arg0, SPEED(arg1), arg2*FRACUNIT, 0, -1, false); } FUNC(LS_Pillar_BuildAndCrush) // Pillar_BuildAndCrush (tag, speed, height, crush, crushtype) { - return EV_DoPillar (DPillar::pillarBuild, arg0, SPEED(arg1), arg2*FRACUNIT, 0, arg3, CRUSHTYPE(arg4)); + return EV_DoPillar (DPillar::pillarBuild, ln, arg0, SPEED(arg1), arg2*FRACUNIT, 0, arg3, CRUSHTYPE(arg4)); } FUNC(LS_Pillar_Open) // Pillar_Open (tag, speed, f_height, c_height) { - return EV_DoPillar (DPillar::pillarOpen, arg0, SPEED(arg1), arg2*FRACUNIT, arg3*FRACUNIT, -1, false); + return EV_DoPillar (DPillar::pillarOpen, ln, arg0, SPEED(arg1), arg2*FRACUNIT, arg3*FRACUNIT, -1, false); } FUNC(LS_Ceiling_LowerByValue) diff --git a/src/p_pillar.cpp b/src/p_pillar.cpp index 1f77c7c7b..809542949 100644 --- a/src/p_pillar.cpp +++ b/src/p_pillar.cpp @@ -212,16 +212,28 @@ DPillar::DPillar (sector_t *sector, EPillar type, fixed_t speed, } } -bool EV_DoPillar (DPillar::EPillar type, int tag, fixed_t speed, fixed_t height, - fixed_t height2, int crush, bool hexencrush) +bool EV_DoPillar (DPillar::EPillar type, line_t *line, int tag, + fixed_t speed, fixed_t height, fixed_t height2, int crush, bool hexencrush) { + int secnum; + sector_t *sec; bool rtn = false; - int secnum = -1; - while ((secnum = P_FindSectorFromTag (tag, secnum)) >= 0) + // check if a manual trigger; if so do just the sector on the backside + if (tag == 0) { - sector_t *sec = §ors[secnum]; + if (!line || !(sec = line->backsector)) + return rtn; + secnum = (int)(sec-sectors); + goto manual_pillar; + } + secnum = -1; + while (tag && (secnum = P_FindSectorFromTag (tag, secnum)) >= 0) + { + sec = §ors[secnum]; + +manual_pillar: if (sec->PlaneMoving(sector_t::floor) || sec->PlaneMoving(sector_t::ceiling)) continue; diff --git a/src/p_spec.h b/src/p_spec.h index a225d2379..0d7ef4cff 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -515,8 +515,8 @@ private: DPillar (); }; -bool EV_DoPillar (DPillar::EPillar type, int tag, fixed_t speed, fixed_t height, - fixed_t height2, int crush, bool hexencrush); +bool EV_DoPillar (DPillar::EPillar type, line_t *line, int tag, + fixed_t speed, fixed_t height, fixed_t height2, int crush, bool hexencrush); // // P_DOORS