even more fixes

This commit is contained in:
Walter Julius Hennecke 2013-06-07 23:08:48 +02:00
parent fe53dc8660
commit 8492668a42

View file

@ -1357,7 +1357,7 @@ static void target_turbolift_startSoundEnd(/*@shared@*/ gentity_t *ent) {
static void target_turbolift_startMove (/*@shared@*/ gentity_t *ent )
{
gentity_t* lights=NULL;
gentity_t* otherLift=NULL;
/*@shared@*/ gentity_t* otherLift=NULL;
gentity_t* tent=NULL;
float time = 0, time2 = 0;
float f = 0;
@ -1423,7 +1423,7 @@ static void target_turbolift_startMove (/*@shared@*/ gentity_t *ent )
}
#endif
}
} else if ( time2 > 0 && lights->targetname2 ) {
} else if ( time2 > 0 && lights->targetname2 != NULL) {
if(Q_stricmp(lights->targetname2, va("%s_up", ent->target)) == 0) {
lights->use(lights, lights, ent );
#ifdef G_LUA
@ -1446,45 +1446,51 @@ static void target_turbolift_startMove (/*@shared@*/ gentity_t *ent )
}
lights = NULL;
if(otherLift->target != NULL) {
while ( ( lights = G_Find( lights, FOFS( targetname ), otherLift->target ) ) != NULL )
{
if ( !Q_stricmp( lights->classname, "func_usable" ) )
if ( Q_stricmp( lights->classname, "func_usable" ) == 0 )
{
if(!rpg_calcLiftTravelDuration.integer) {
if(rpg_calcLiftTravelDuration.integer == 0) {
lights->use( lights, lights, ent );
#ifdef G_LUA
if(lights->luaUse)
if(lights->luaUse != NULL) {
LuaHook_G_EntityUse(lights->luaUse, lights-g_entities, ent-g_entities, ent-g_entities);
}
#endif
}
else {
if(time2 < 0 && lights->targetname2) {
if(!Q_stricmp(lights->targetname2, va("%s_dn", otherLift->target))) {
if(time2 < 0 && lights->targetname2 != NULL) {
if(Q_stricmp(lights->targetname2, va("%s_dn", otherLift->target)) == 0) {
lights->use(lights, lights, ent);
#ifdef G_LUA
if(lights->luaUse);
if(lights->luaUse != NULL) {
LuaHook_G_EntityUse(lights->luaUse, lights-g_entities, ent-g_entities, ent-g_entities);
}
#endif
}
} else if(time2 > 0 && lights->targetname2) {
if(!Q_stricmp(lights->targetname2, va("%s_up", otherLift->target))) {
} else if(time2 > 0 && lights->targetname2 != NULL) {
if(Q_stricmp(lights->targetname2, va("%s_up", otherLift->target)) == 0) {
lights->use(lights, lights, ent);
#ifdef G_LUA
if(lights->luaUse)
if(lights->luaUse != NULL) {
LuaHook_G_EntityUse(lights->luaUse, lights-g_entities, ent-g_entities, ent-g_entities);
}
#endif
}
} else {
lights->use(lights, lights, ent);
#ifdef G_LUA
if(lights->luaUse)
if(lights->luaUse != NULL) {
LuaHook_G_EntityUse(lights->luaUse, lights-g_entities, ent-g_entities, ent-g_entities);
}
#endif
}
}
}
}
}
}
// check for shader remaps
if(rpg_calcLiftTravelDuration.integer || level.overrideCalcLiftTravelDuration) {