void wall_frame_process() { int i; for (i=0;i<Num_open_doors;i++) { active_door *d; wall *w; d = &ActiveDoors[i]; w = &Walls[d->front_wallnum[0]]; if (w->state == WALL_DOOR_OPENING) do_door_open(i); else if (w->state == WALL_DOOR_CLOSING) do_door_close(i); else if (w->state == WALL_DOOR_WAITING) { d->time += FrameTime; // set flags to fix occasional netgame problem where door is waiting to close but open flag isn't set // NOTE: Taken from D2 source. Should not be necessary as multi_do_door_open() is more simple than in D2 but add anyways as it's a *good* fallback... w->flags |= WALL_DOOR_OPENED; if (d->back_wallnum[0] > -1) Walls[d->back_wallnum[0]].flags |= WALL_DOOR_OPENED; if (d->time > DOOR_WAIT_TIME) { w->state = WALL_DOOR_CLOSING; d->time = 0; } } } }
void wall_frame_process() { int i; for (i=0;i<Num_open_doors;i++) { active_door *d; wall *w; d = &ActiveDoors[i]; w = &Walls[d->front_wallnum[0]]; if (w->state == WALL_DOOR_OPENING) do_door_open(i); else if (w->state == WALL_DOOR_CLOSING) do_door_close(i); else if (w->state == WALL_DOOR_WAITING) { d->time += FrameTime; // set flags to fix occasional netgame problem where door is waiting to close but open flag isn't set w->flags |= WALL_DOOR_OPENED; if (d->back_wallnum[0] > -1) Walls[d->back_wallnum[0]].flags |= WALL_DOOR_OPENED; if (d->time > DOOR_WAIT_TIME && is_door_free(&Segments[w->segnum],w->sidenum)) { w->state = WALL_DOOR_CLOSING; d->time = 0; } } else if (w->state == WALL_DOOR_CLOSED || w->state == WALL_DOOR_OPEN) { //this shouldn't happen. if the wall is in one of these states, //there shouldn't be an activedoor entry for it. So we'll kill //the activedoor entry. Tres simple. int t; Int3(); //a bad thing has happened, but I'll try to fix it up for (t=i;t<Num_open_doors;t++) ActiveDoors[t] = ActiveDoors[t+1]; Num_open_doors--; } } for (i=0;i<Num_cloaking_walls;i++) { cloaking_wall *d; wall *w; d = &CloakingWalls[i]; w = &Walls[d->front_wallnum]; if (w->state == WALL_DOOR_CLOAKING) do_cloaking_wall_frame(i); else if (w->state == WALL_DOOR_DECLOAKING) do_decloaking_wall_frame(i); #ifdef _DEBUG else Int3(); //unexpected wall state #endif } }
void wall_frame_process() { int i; for (i=0;i<Num_open_doors;i++) { active_door *d; wall *w; d = &ActiveDoors[i]; w = &Walls[d->front_wallnum[0]]; if (w->state == WALL_DOOR_OPENING) do_door_open(i); else if (w->state == WALL_DOOR_CLOSING) do_door_close(i); else if (w->state == WALL_DOOR_WAITING) { d->time += FrameTime; if (d->time > DOOR_WAIT_TIME) { w->state = WALL_DOOR_CLOSING; d->time = 0; } } } }