mirror of
https://github.com/UberGames/RPG-X2.git
synced 2025-01-31 12:30:33 +00:00
func_stasis_door
Found my errors. There still is a problem with the trigger though.
This commit is contained in:
parent
daf1201460
commit
09559579cc
1 changed files with 10 additions and 6 deletions
|
@ -3367,7 +3367,6 @@ void toggle_stasis_door( gentity_t *ent )
|
|||
{
|
||||
gentity_t *parent = ent->parent;
|
||||
ent->nextthink = -1; // prevent thinking again until this think is finished
|
||||
parent->nextthink = -1;
|
||||
switch(parent->count) {
|
||||
case STASIS_DOOR_CLOSED: // then go to opening state
|
||||
G_Printf(S_COLOR_MAGENTA"STASIS_DOOR_CLOSED\n");
|
||||
|
@ -3375,13 +3374,16 @@ void toggle_stasis_door( gentity_t *ent )
|
|||
parent->r.svFlags |= SVF_NOCLIENT;
|
||||
parent->s.eFlags |= EF_NODRAW;
|
||||
parent->count = STASIS_DOOR_OPENING;
|
||||
parent->nextthink = level.time + 1000;
|
||||
ent->nextthink = level.time + 1000;
|
||||
trap_LinkEntity(parent);
|
||||
break;
|
||||
case STASIS_DOOR_CLOSING: // then go to closed state
|
||||
G_Printf(S_COLOR_MAGENTA"STASIS_DOOR_CLOSING\n");
|
||||
G_AddEvent(parent, EV_STASIS_DOOR_CLOSED, 0); // setnd event to client
|
||||
parent->r.contents = CONTENTS_SOLID;
|
||||
trap_SetBrushModel(parent, parent->model);
|
||||
InitMover( parent );
|
||||
VectorCopy( parent->s.origin, parent->s.pos.trBase );
|
||||
VectorCopy( parent->s.origin, parent->r.currentOrigin );
|
||||
parent->r.contents &= ~SVF_NOCLIENT;
|
||||
parent->s.eFlags &= ~EF_NODRAW;
|
||||
trap_AdjustAreaPortalState(parent, qfalse); // close AP
|
||||
|
@ -3391,8 +3393,10 @@ void toggle_stasis_door( gentity_t *ent )
|
|||
case STASIS_DOOR_OPENED: // then go to closing state
|
||||
G_Printf(S_COLOR_MAGENTA"STASIS_DOOR_OPENED\n");
|
||||
G_AddEvent(parent, EV_STASIS_DOOR_CLOSING, 0); // send event to client
|
||||
parent->r.contents = CONTENTS_SOLID;
|
||||
parent->count = STASIS_DOOR_CLOSING;
|
||||
parent->nextthink = level.time + 1000;
|
||||
ent->nextthink = level.time + 1000;
|
||||
trap_LinkEntity(parent);
|
||||
break;
|
||||
case STASIS_DOOR_OPENING: // then go to opened state
|
||||
G_Printf(S_COLOR_MAGENTA"STASIS_DOOR_OPENING\n");
|
||||
|
@ -3401,7 +3405,7 @@ void toggle_stasis_door( gentity_t *ent )
|
|||
trap_AdjustAreaPortalState(parent, qtrue); // open AP
|
||||
trap_LinkEntity(parent);
|
||||
parent->count = STASIS_DOOR_OPENED;
|
||||
parent->nextthink = level.time + 3000;
|
||||
ent->nextthink = level.time + 3000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3531,7 +3535,7 @@ void SP_func_stasis_door( gentity_t *ent )
|
|||
|
||||
// Auto create a door trigger so the designers don't have to
|
||||
ent->think = spawn_trigger_stasis_door;
|
||||
ent->nextthink = level.time + 50 * 5; // give the target a chance to spawn in
|
||||
ent->nextthink = level.time + 500; // give the target a chance to spawn in
|
||||
|
||||
ent->use = use_stasis_door;
|
||||
ent->count = -1;
|
||||
|
|
Loading…
Reference in a new issue