Пример #1
0
/*
===============
SP_trigger_buildable
===============
*/
void SP_trigger_buildable( gentity_t *self )
{
    char *buffer;

    G_SpawnFloat( "wait", "0.5", &self->wait );
    G_SpawnFloat( "random", "0", &self->random );

    if( self->random >= self->wait && self->wait >= 0 )
    {
        self->random = self->wait - FRAMETIME;
        G_Printf( S_COLOR_YELLOW "WARNING: trigger_buildable has random >= wait\n" );
    }

    G_SpawnString( "buildables", "", &buffer );

    BG_ParseCSVBuildableList( buffer, self->bTriggers, BA_NUM_BUILDABLES );

    self->touch = trigger_buildable_touch;
    self->use = trigger_buildable_use;

    // SPAWN_DISABLED
    if( self->spawnflags & 1 )
        self->s.eFlags |= EF_NODRAW;

    // NEGATE
    if( self->spawnflags & 2 )
        self->s.eFlags |= EF_DEAD;

    InitTrigger( self );
    trap_LinkEntity( self );
}
Пример #2
0
void SP_ConditionFields( gentity_t *self ) {
	char *buffer;

	if ( G_SpawnString( "buildables", "", &buffer ) )
		BG_ParseCSVBuildableList( buffer, self->conditions.buildables, BA_NUM_BUILDABLES );

	if ( G_SpawnString( "classes", "", &buffer ) )
		BG_ParseCSVClassList( buffer, self->conditions.classes, PCL_NUM_CLASSES );

	if ( G_SpawnString( "equipment", "", &buffer ) )
		BG_ParseCSVEquipmentList( buffer, self->conditions.weapons, WP_NUM_WEAPONS,
	                          self->conditions.upgrades, UP_NUM_UPGRADES );

}