Exemplo n.º 1
0
void script_mover_set_blocking(gentity_t *ent)
{
	if (ent->r.linked && ent->r.contents == CONTENTS_SOLID)
	{
		G_SetAASBlockingEntity(ent, AAS_AREA_AVOID);
	}
}
Exemplo n.º 2
0
void script_mover_aas_blocking( gentity_t *ent ) {
	if( ent->timestamp <= level.time ) {
		// are we moving?
		if (ent->s.pos.trType != TR_STATIONARY /*VectorLengthSquared( ent->s.pos.trDelta )*/) {
			// never block while moving
			if (ent->AASblocking) {
				G_SetAASBlockingEntity( ent, AAS_AREA_ENABLED );
			}
		} else if (!VectorCompare( ent->s.pos.trBase, ent->botAreaPos )) {
			script_mover_set_blocking( ent );
			VectorCopy( ent->s.pos.trBase, ent->botAreaPos );
		}
		ent->timestamp = level.time + 500;
	}

	if( ent->spawnflags & 128 ) {
		if( !ent->tankLink ) {
			if( ent->mg42weapHeat ) {
				ent->mg42weapHeat -= int(300.0f * FRAMETIME * 0.001f);

				if( ent->mg42weapHeat < 0 )
					ent->mg42weapHeat = 0;
			}

			if( ent->backupWeaponTime ) {
				ent->backupWeaponTime -= FRAMETIME;

				if( ent->backupWeaponTime < 0 )
					ent->backupWeaponTime = 0;
			}
		}
	}

	ent->nextthink = level.time + FRAMETIME;
}
Exemplo n.º 3
0
/*
==============
Use_Target_Lock
==============
*/
void Use_Target_Lock(gentity_t *ent, gentity_t *other, gentity_t *activator)
{
	gentity_t *t = 0;

	while ((t = G_Find(t, FOFS(targetname), ent->target)) != NULL)
	{
//		G_Printf("target_lock locking entity with key: %d\n", ent->count);
		t->key = ent->key;
		if (t->key)
		{
			G_SetAASBlockingEntity(t, AAS_AREA_DISABLED);
		}
		else
		{
			G_SetAASBlockingEntity(t, AAS_AREA_ENABLED);
		}
	}

}
Exemplo n.º 4
0
void Use_Target_Lock(gentity_t *ent, gentity_t *other, gentity_t *activator)
{
    gentity_t   *t = 0;

    while((t = G_Find(t, FOFS(targetname), ent->target)) != NULL)
    {
        t->key = ent->key;
        G_SetAASBlockingEntity(t, t->key != 0);
    }

}
Exemplo n.º 5
0
/*
==============
Use_Target_Lock
==============
*/
void Use_Target_Lock( gentity_t *ent, gentity_t *other, gentity_t *activator )
{
	gentity_t	*t = 0;

	while ( (t = G_Find (t, FOFS(targetname), ent->target)) != NULL )
	{
//		G_Printf("target_lock locking entity with key: %d\n", ent->count);
		t->key = ent->key;
		G_SetAASBlockingEntity( t, t->key != 0 );
	}

}