guess what

This commit is contained in:
Walter Julius Hennecke 2013-06-07 23:14:32 +02:00
parent 8492668a42
commit c2f975c25b

View file

@ -1493,13 +1493,13 @@ static void target_turbolift_startMove (/*@shared@*/ gentity_t *ent )
} }
// check for shader remaps // check for shader remaps
if(rpg_calcLiftTravelDuration.integer || level.overrideCalcLiftTravelDuration) { if(rpg_calcLiftTravelDuration.integer != 0|| level.overrideCalcLiftTravelDuration != 0) {
if(time2 < 0 && ent->truename && otherLift->truename) { if(time2 < 0 && ent->truename != NULL && otherLift->truename != NULL) {
f = level.time * 0.001; f = (float)(level.time * 0.001f);
AddRemap(ent->targetShaderName, ent->truename, f); AddRemap(ent->targetShaderName, ent->truename, f);
AddRemap(otherLift->targetShaderName, otherLift->truename, f); AddRemap(otherLift->targetShaderName, otherLift->truename, f);
} else if(time2 > 0 && ent->falsename && otherLift->falsename) { } else if(time2 > 0 && ent->falsename != NULL && otherLift->falsename != NULL) {
f = level.time * 0.001; f = (float)(level.time * 0.001f);
AddRemap(ent->targetShaderName, ent->falsename, f); AddRemap(ent->targetShaderName, ent->falsename, f);
AddRemap(otherLift->targetShaderName, otherLift->falsename, f); AddRemap(otherLift->targetShaderName, otherLift->falsename, f);
} }
@ -1507,7 +1507,7 @@ static void target_turbolift_startMove (/*@shared@*/ gentity_t *ent )
} }
if(rpg_calcLiftTravelDuration.integer) { if(rpg_calcLiftTravelDuration.integer) {
ent->s.eventParm = time2; ent->s.eventParm = (int)time2;
time *= rpg_liftDurationModifier.value; time *= rpg_liftDurationModifier.value;
time *= 1000; time *= 1000;
ent->s.time2 = level.time + time; ent->s.time2 = level.time + time;
@ -1525,21 +1525,22 @@ static void target_turbolift_startMove (/*@shared@*/ gentity_t *ent )
} }
} }
static void target_turbolift_shutDoors ( gentity_t *ent ) static void target_turbolift_shutDoors (/*@shared@*/ gentity_t *ent )
{ {
gentity_t* door=NULL; gentity_t* door=NULL;
gentity_t* otherLift=NULL; gentity_t* otherLift=NULL;
otherLift = &g_entities[ent->count]; otherLift = &g_entities[ent->count];
if ( !otherLift ) if ( otherLift == NULL )
{ {
target_turbolift_unlock( ent ); target_turbolift_unlock( ent );
return; return;
} }
if(ent->target != NULL) {
while ( ( door = G_Find( door, FOFS( targetname ), ent->target )) != NULL ) while ( ( door = G_Find( door, FOFS( targetname ), ent->target )) != NULL )
{ {
if ( !Q_stricmp( door->classname, "func_door" ) ) if ( Q_stricmp( door->classname, "func_door" ) == 0 )
{ {
if ( door->moverState != MOVER_POS1 ) { if ( door->moverState != MOVER_POS1 ) {
ent->nextthink = level.time + 500; ent->nextthink = level.time + 500;
@ -1547,11 +1548,13 @@ static void target_turbolift_shutDoors ( gentity_t *ent )
} }
} }
} }
}
door = NULL; door = NULL;
if(otherLift->target != NULL) {
while ( ( door = G_Find( door, FOFS( targetname ), otherLift->target )) != NULL ) while ( ( door = G_Find( door, FOFS( targetname ), otherLift->target )) != NULL )
{ {
if ( !Q_stricmp( door->classname, "func_door" ) ) if ( Q_stricmp( door->classname, "func_door" ) == 0 )
{ {
if ( door->moverState != MOVER_POS1 ) { if ( door->moverState != MOVER_POS1 ) {
ent->nextthink = level.time + 500; ent->nextthink = level.time + 500;
@ -1559,20 +1562,21 @@ static void target_turbolift_shutDoors ( gentity_t *ent )
} }
} }
} }
}
//start phase 3 //start phase 3
ent->think = target_turbolift_startMove; ent->think = target_turbolift_startMove;
ent->nextthink = level.time + FRAMETIME; ent->nextthink = level.time + FRAMETIME;
} }
void target_turbolift_start ( gentity_t *self ) void target_turbolift_start (/*@shared@*/ gentity_t *self )
{ {
gentity_t* otherLift; gentity_t* otherLift;
//get target deck number lift entity //get target deck number lift entity
otherLift = &g_entities[self->count]; otherLift = &g_entities[self->count];
if ( !otherLift ) if ( otherLift == NULL)
{ {
target_turbolift_unlock( self ); target_turbolift_unlock( self );
return; return;
@ -1583,9 +1587,10 @@ void target_turbolift_start ( gentity_t *self )
{ {
gentity_t *door=NULL; gentity_t *door=NULL;
if(self->target != NULL) {
while ( ( door = G_Find( door, FOFS( targetname ), self->target )) != NULL ) while ( ( door = G_Find( door, FOFS( targetname ), self->target )) != NULL )
{ {
if ( !Q_stricmp( door->classname, "func_door" ) ) if ( Q_stricmp( door->classname, "func_door" ) == 0 )
{ {
door->flags |= FL_CLAMPED; door->flags |= FL_CLAMPED;
if ( door->moverState != MOVER_POS1 ) if ( door->moverState != MOVER_POS1 )
@ -1594,8 +1599,10 @@ void target_turbolift_start ( gentity_t *self )
} }
} }
} }
}
door = NULL; door = NULL;
if(otherLift->target != NULL) {
while ( ( door = G_Find( door, FOFS( targetname ), otherLift->target )) != NULL ) while ( ( door = G_Find( door, FOFS( targetname ), otherLift->target )) != NULL )
{ {
if ( !Q_stricmp( door->classname, "func_door" ) ) if ( !Q_stricmp( door->classname, "func_door" ) )
@ -1608,6 +1615,7 @@ void target_turbolift_start ( gentity_t *self )
} }
} }
} }
}
//phase 2 - wait until both doors are shut //phase 2 - wait until both doors are shut
self->think = target_turbolift_shutDoors; self->think = target_turbolift_shutDoors;