Solved. I needed to start off with AIRLOCKOUTER_status = DOOR_CLOSED
I have run into this. Where you have to first a key twice to start the animation. After its starts then you only have to press once.
Here is the code:
from the H file:
I have run into this. Where you have to first a key twice to start the animation. After its starts then you only have to press once.
Here is the code:
Code:
AIRLOCKOUTER_status = DOOR_OPEN;
AIRLOCKOUTER_proc = 0;
if (AIRLOCKOUTER_status >= DOOR_CLOSING) {
double da = simdt * LIFT_SPEED;
if (AIRLOCKOUTER_status == DOOR_CLOSING) {
if (AIRLOCKOUTER_proc > 0.0) AIRLOCKOUTER_proc = max (0.0, AIRLOCKOUTER_proc-da);
else AIRLOCKOUTER_status = DOOR_CLOSED;
} else {
if (AIRLOCKOUTER_proc < 1.0) AIRLOCKOUTER_proc = min (1.0, AIRLOCKOUTER_proc+da);
else AIRLOCKOUTER_status = DOOR_OPEN;
}
SetAnimation (anim_airlockouter, AIRLOCKOUTER_proc);
}
case OAPI_KEY_D: // outer airlock
RevertAIRLOCKOUTER();
return 1;
void ML::RevertAIRLOCKOUTER (void)
{
ActivateAIRLOCKOUTER (AIRLOCKOUTER_status == DOOR_CLOSED || AIRLOCKOUTER_status == DOOR_CLOSING ?
DOOR_OPENING : DOOR_CLOSING);
}
void ML::ActivateAIRLOCKOUTER (DoorStatus action)
{
AIRLOCKOUTER_status = action;
}
Code:
enum DoorStatus { DOOR_CLOSED, DOOR_OPEN, DOOR_CLOSING, DOOR_OPENING } CABDOOR_status, AIRLOCKOUTER_status, AIRLOCKINNER_status;
void RevertAIRLOCKOUTER (void);
void ActivateAIRLOCKOUTER (DoorStatus action);
Last edited: