This commit is contained in:
Walter Julius Hennecke 2013-06-07 22:53:20 +02:00
parent c7f9f348f8
commit 4479d9ce51
3 changed files with 23 additions and 16 deletions

View File

@ -1032,7 +1032,7 @@ void SP_target_evosuit (gentity_t *self) {
//
//==================================================================================
static void target_turbolift_unlock ( gentity_t *ent )
static void target_turbolift_unlock ( /*@shared@*/ gentity_t *ent )
{
gentity_t* otherLift;
@ -1175,7 +1175,7 @@ static void target_turbolift_endMove ( /*@shared@*/ gentity_t *ent )
}
#endif
}
} else if(ent->s.eventParm && lights->targetname2 != NULL) {
} else if(ent->s.eventParm != 0 && lights->targetname2 != NULL) {
if(Q_stricmp(lights->targetname2, va("%s_up", otherLift->target)) == 0) {
lights->use(lights, lights, ent);
#ifdef G_LUA
@ -1201,7 +1201,7 @@ static void target_turbolift_endMove ( /*@shared@*/ gentity_t *ent )
// check for shader remaps
if(rpg_calcLiftTravelDuration.integer != 0 || level.overrideCalcLiftTravelDuration != 0) {
if((ent->truename != NULL && otherLift->truename != NULL) || (ent->falsename != NULL && otherLift->falsename != NULL)) {
f = level.time * 0.001;
f = level.time * 0.001f;
AddRemap(ent->targetShaderName, ent->targetShaderName, f);
AddRemap(otherLift->targetShaderName, otherLift->targetShaderName, f);
}
@ -1278,10 +1278,11 @@ static void target_turbolift_TeleportPlayers ( gentity_t *ent )
}
liftTouch = (int *)malloc(MAX_GENTITIES * sizeof(int));
if(!liftTouch) {
if(liftTouch == NULL) {
target_turbolift_unlock( ent );
return;
}
memset(liftTouch, 0, sizeof(int) * MAX_GENTITIES);
//scan the turbo region for players
//in the current lift
@ -1298,11 +1299,12 @@ static void target_turbolift_TeleportPlayers ( gentity_t *ent )
}
targetLiftTouch = (int *)malloc(MAX_GENTITIES * sizeof(int));
if(!targetLiftTouch) {
if(targetLiftTouch == NULL) {
target_turbolift_unlock( ent );
free(liftTouch);
return;
}
memset(targetLiftTouch, 0, sizeof(int) * MAX_GENTITIES);
//the target lift
{
@ -1323,8 +1325,8 @@ static void target_turbolift_TeleportPlayers ( gentity_t *ent )
//TiM - Teleport the main players
TeleportPlayers( ent, targetLift, liftNumEnts, liftTouch );
if(rpg_calcLiftTravelDuration.integer) {
time = targetLift->health - ent->health;
if(rpg_calcLiftTravelDuration.integer != 0) {
time = (float)(targetLift->health - ent->health);
if(time < 0)
time *= -1;
time *= rpg_liftDurationModifier.value;
@ -1343,8 +1345,13 @@ static void target_turbolift_TeleportPlayers ( gentity_t *ent )
static void target_turbolift_startSoundEnd(gentity_t *ent) {
ent->nextthink = -1;
ent->parent->r.svFlags &= ~SVF_NOCLIENT;
ent->touched->r.svFlags &= ~SVF_NOCLIENT;
if(ent->parent != NULL) {
ent->parent->r.svFlags &= ~SVF_NOCLIENT;
}
if(ent->touched != NULL) {
ent->touched->r.svFlags &= ~SVF_NOCLIENT;
}
}
static void target_turbolift_startMove ( gentity_t *ent )
@ -1356,18 +1363,18 @@ static void target_turbolift_startMove ( gentity_t *ent )
float f = 0;
otherLift = &g_entities[ent->count];
if ( !otherLift )
if ( otherLift == NULL )
{
target_turbolift_unlock( ent );
return;
}
//play move sound
if( rpg_calcLiftTravelDuration.integer ) {
time = time2 = ent->health - otherLift->health;
if( rpg_calcLiftTravelDuration.integer != 0 ) {
time = time2 = (float)(ent->health - otherLift->health);
if(time < 0)
time *= -1;
if(ent->sound2to1) {
if(ent->sound2to1 != 0) {
if( rpg_liftDurationModifier.value * 1000 * time >= ent->distance * 1000 ) {
tent = G_Spawn();
tent->think = target_turbolift_startSoundEnd;

View File

@ -57,7 +57,7 @@ void AddRemap(const char *oldShader, const char *newShader, float timeOffset) {
*
* @return the shader state config
*/
const char *BuildShaderStateConfig(void) {
/*@shared@*/ const char *BuildShaderStateConfig(void) {
static char buff[MAX_STRING_CHARS*4];
char out[(MAX_QPATH * 2) + 5];
int i;

View File

@ -603,7 +603,7 @@ float Q_crandom( int *seed );
float flrandom(float min, float max);
int irandom(int min, int max);
void vectoangles( const vec3_t value1, vec3_t angles);
void vectoangles( const vec3_t value1, /*@out@*/ vec3_t angles);
void AnglesToAxis( const vec3_t angles, vec3_t axis[3] );
void AxisClear( vec3_t axis[3] );
@ -631,7 +631,7 @@ void MakeNormalVectors( const vec3_t forward, vec3_t right, vec3_t up );
int PlaneTypeForNormal (vec3_t normal);
void MatrixMultiply(float in1[3][3], float in2[3][3], float out[3][3]);
void AngleVectors( const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
void AngleVectors( const vec3_t angles, /*@out@*/ vec3_t forward, /*@out@*/ vec3_t right, /*@out@*/ vec3_t up);
void PerpendicularVector( vec3_t dst, const vec3_t src );
void VectorShort(vec3_t vect);
void UnVectorShort(vec3_t vect);