From 4c9a85fa61a4298b342a76d4ac128c036b199055 Mon Sep 17 00:00:00 2001 From: Samuel Villareal Date: Tue, 14 Sep 2010 06:24:04 +0000 Subject: + P_FindSlidingDoorType fixed where it was returning a null slidetype + EV_SlideDoor updated + Linetypes 207 (RemoteSlideDoor) and linetype 229 (Sigil SlideDoor) added + T_MovePlane updated Subversion-branch: /branches/strife-branch Subversion-revision: 2085 --- src/strife/p_doors.c | 50 +++++++++++++++++++++++++++++++++++------------ src/strife/p_floor.c | 54 +++++++++++++++++++++++++++++---------------------- src/strife/p_spec.h | 1 + src/strife/p_switch.c | 13 +++++++++++++ 4 files changed, 83 insertions(+), 35 deletions(-) diff --git a/src/strife/p_doors.c b/src/strife/p_doors.c index 85fb4274..fa86ebf6 100644 --- a/src/strife/p_doors.c +++ b/src/strife/p_doors.c @@ -737,7 +737,7 @@ int P_FindSlidingDoorType(line_t* line) int i; int val; - for(i = 0; i < MAXSLIDEDOORS; i++) + for(i = 0; i < MAXSLIDEDOORS-1; i++) { val = sides[line->sidenum[0]].toptexture; if(val == slideFrames[i].frames[0]) @@ -805,13 +805,12 @@ void T_SlidingDoor(slidedoor_t* door) if(!door->timer--) { fixed_t speed; - boolean thinglist; + fixed_t cheight; sec = door->frontsector; - thinglist = (sec->thinglist != NULL); // CAN DOOR CLOSE? - if(thinglist) + if(sec->thinglist != NULL) { door->timer = SDOORWAIT; return; @@ -819,12 +818,11 @@ void T_SlidingDoor(slidedoor_t* door) else { - speed = sec->ceilingheight - - sec->floorheight - (10*FRACUNIT); + cheight = sec->ceilingheight; + speed = cheight - sec->floorheight - (10*FRACUNIT); // something blocking it? - // [STRIFE] TODO this function here is causing some abnormalites when closing - if(T_MovePlane(sec, speed, sec->floorheight, thinglist, 1, -1) == 1) + if(T_MovePlane(sec, speed, sec->floorheight, 0, 1, -1) == crushed) { door->timer = SDOORWAIT; return; @@ -832,7 +830,7 @@ void T_SlidingDoor(slidedoor_t* door) else { // Instantly move plane - T_MovePlane(sec, (128*FRACUNIT), sec->ceilingheight, 0, 1, 1); + T_MovePlane(sec, (128*FRACUNIT), cheight, 0, 1, 1); // turn line blocking back on door->line1->flags |= ML_BLOCKING; @@ -886,10 +884,39 @@ void T_SlidingDoor(slidedoor_t* door) // // EV_RemoteSlidingDoor // -// villsa [STRIFE] TODO +// villsa [STRIFE] new function // -void EV_RemoteSlidingDoor(line_t* line, mobj_t* thing) +int EV_RemoteSlidingDoor(line_t* line, mobj_t* thing) { + int secnum; + sector_t* sec; + slidedoor_t* door; + int i; + int rtn; + line_t* secline; + + secnum = -1; + rtn = 0; + + while((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0) + { + sec = §ors[secnum]; + if(sec->specialdata) + continue; + + for(i = 0; i < 4; i++) + { + secline = sec->lines[i]; + + if(P_FindSlidingDoorType(secline) < 0) + continue; + + EV_SlidingDoor(secline, thing); + rtn = 1; + } + } + + return rtn; } @@ -918,7 +945,6 @@ void EV_SlidingDoor(line_t* line, mobj_t* thing) { if(door->status == sd_waiting) { - // [STRIFE] TODO lines are still passable when closed manually by player door->status = sd_closing; door->timer = SWAITTICS; // villsa [STRIFE] } diff --git a/src/strife/p_floor.c b/src/strife/p_floor.c index edeb44a1..8f434fe6 100644 --- a/src/strife/p_floor.c +++ b/src/strife/p_floor.c @@ -68,28 +68,35 @@ T_MovePlane // DOWN if (sector->floorheight - speed < dest) { - lastpos = sector->floorheight; + // villsa [STRIFE] unused + //lastpos = sector->floorheight; sector->floorheight = dest; flag = P_ChangeSector(sector,crush); - if (flag == true) + + // villsa [STRIFE] unused + /*if (flag == true) { sector->floorheight =lastpos; P_ChangeSector(sector,crush); //return crushed; - } + }*/ return pastdest; } else { - lastpos = sector->floorheight; + // villsa [STRIFE] unused + //lastpos = sector->floorheight; sector->floorheight -= speed; flag = P_ChangeSector(sector,crush); - if (flag == true) + + // villsa [STRIFE] unused + /*if (flag == true) { sector->floorheight = lastpos; P_ChangeSector(sector,crush); return crushed; - } + }*/ + return ok; } break; @@ -116,12 +123,15 @@ T_MovePlane flag = P_ChangeSector(sector,crush); if (flag == true) { - if (crush == true) - return crushed; + // villsa [STRIFE] unused + //if (crush == true) + //return crushed; sector->floorheight = lastpos; P_ChangeSector(sector,crush); return crushed; } + else + return ok; } break; } @@ -169,31 +179,29 @@ T_MovePlane // UP if (sector->ceilingheight + speed > dest) { - lastpos = sector->ceilingheight; + // villsa [STRIFE] unused + //lastpos = sector->ceilingheight; sector->ceilingheight = dest; - flag = P_ChangeSector(sector,crush); - if (flag == true) + + // villsa [STRIFE] unused + //flag = P_ChangeSector(sector,crush); + /*if (flag == true) { sector->ceilingheight = lastpos; P_ChangeSector(sector,crush); //return crushed; - } + }*/ return pastdest; } else { - lastpos = sector->ceilingheight; + // villsa [STRIFE] unused + //lastpos = sector->ceilingheight; sector->ceilingheight += speed; - flag = P_ChangeSector(sector,crush); -// UNUSED -#if 0 - if (flag == true) - { - sector->ceilingheight = lastpos; - P_ChangeSector(sector,crush); - return crushed; - } -#endif + + // villsa [STRIFE] unused + //flag = P_ChangeSector(sector,crush); + return ok; } break; } diff --git a/src/strife/p_spec.h b/src/strife/p_spec.h index b3bb29af..763591a0 100644 --- a/src/strife/p_spec.h +++ b/src/strife/p_spec.h @@ -488,6 +488,7 @@ typedef struct void P_InitSlidingDoorFrames(void); void EV_SlidingDoor(line_t* line, mobj_t* thing); +int EV_RemoteSlidingDoor(line_t* line, mobj_t* thing); diff --git a/src/strife/p_switch.c b/src/strife/p_switch.c index 9ba321f7..6c88e885 100644 --- a/src/strife/p_switch.c +++ b/src/strife/p_switch.c @@ -820,6 +820,19 @@ P_UseSpecialLine EV_SlidingDoor(line, thing); break; + case 207: + // villsa [STRIFE] remote sliding door + if(EV_RemoteSlidingDoor(line, thing)) + P_ChangeSwitchTexture(line, 1); + + case 229: + // villsa [STRIFE] sigil sliding door + if(thing->player && thing->player->sigiltype == 4) + { + if(EV_RemoteSlidingDoor(line, thing)) + P_ChangeSwitchTexture(line, 1); + } + case 666: // villsa [STRIFE] Move wall P_MoveWall(line, thing); -- cgit v1.2.3