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,37 +1525,41 @@ 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;
} }
while ( ( door = G_Find( door, FOFS( targetname ), ent->target )) != NULL ) if(ent->target != NULL) {
{ while ( ( door = G_Find( door, FOFS( targetname ), ent->target )) != NULL )
if ( !Q_stricmp( door->classname, "func_door" ) )
{ {
if ( door->moverState != MOVER_POS1 ) { if ( Q_stricmp( door->classname, "func_door" ) == 0 )
ent->nextthink = level.time + 500; {
return; if ( door->moverState != MOVER_POS1 ) {
ent->nextthink = level.time + 500;
return;
}
} }
} }
} }
door = NULL; door = NULL;
while ( ( door = G_Find( door, FOFS( targetname ), otherLift->target )) != NULL ) if(otherLift->target != NULL) {
{ while ( ( door = G_Find( door, FOFS( targetname ), otherLift->target )) != NULL )
if ( !Q_stricmp( door->classname, "func_door" ) )
{ {
if ( door->moverState != MOVER_POS1 ) { if ( Q_stricmp( door->classname, "func_door" ) == 0 )
ent->nextthink = level.time + 500; {
return; if ( door->moverState != MOVER_POS1 ) {
ent->nextthink = level.time + 500;
return;
}
} }
} }
} }
@ -1565,14 +1569,14 @@ static void target_turbolift_shutDoors ( gentity_t *ent )
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,27 +1587,31 @@ void target_turbolift_start ( gentity_t *self )
{ {
gentity_t *door=NULL; gentity_t *door=NULL;
while ( ( door = G_Find( door, FOFS( targetname ), self->target )) != NULL ) if(self->target != NULL) {
{ while ( ( door = G_Find( door, FOFS( targetname ), self->target )) != NULL )
if ( !Q_stricmp( door->classname, "func_door" ) )
{ {
door->flags |= FL_CLAMPED; if ( Q_stricmp( door->classname, "func_door" ) == 0 )
if ( door->moverState != MOVER_POS1 )
{ {
door->nextthink = level.time; door->flags |= FL_CLAMPED;
if ( door->moverState != MOVER_POS1 )
{
door->nextthink = level.time;
}
} }
} }
} }
door = NULL; door = NULL;
while ( ( door = G_Find( door, FOFS( targetname ), otherLift->target )) != NULL ) if(otherLift->target != NULL) {
{ while ( ( door = G_Find( door, FOFS( targetname ), otherLift->target )) != NULL )
if ( !Q_stricmp( door->classname, "func_door" ) )
{ {
door->flags |= FL_CLAMPED; if ( !Q_stricmp( door->classname, "func_door" ) )
if ( door->moverState != MOVER_POS1 )
{ {
door->nextthink = level.time; door->flags |= FL_CLAMPED;
if ( door->moverState != MOVER_POS1 )
{
door->nextthink = level.time;
}
} }
} }
} }