| 2099 | } |
| 2100 | |
| 2101 | void SP_NPC_Vehicle( gentity_t *self) |
| 2102 | { |
| 2103 | if ( !self->NPC_type ) |
| 2104 | { |
| 2105 | self->NPC_type = "swoop"; |
| 2106 | } |
| 2107 | |
| 2108 | if ( !self->classname ) |
| 2109 | { |
| 2110 | self->classname = "NPC_Vehicle"; |
| 2111 | } |
| 2112 | |
| 2113 | G_SetOrigin( self, self->s.origin ); |
| 2114 | G_SetAngles( self, self->s.angles ); |
| 2115 | G_SpawnString("skin", "", &self->soundSet); |
| 2116 | |
| 2117 | //grab this from the spawner |
| 2118 | if ( (self->spawnflags&1) ) |
| 2119 | {//wants to explode when not in vis of player |
| 2120 | if ( !self->endFrame ) |
| 2121 | { |
| 2122 | self->endFrame = NO_PILOT_DIE_TIME; |
| 2123 | } |
| 2124 | } |
| 2125 | |
| 2126 | if ( self->targetname ) |
| 2127 | { |
| 2128 | self->svFlags |= SVF_NPC_PRECACHE; // Precache The Bike when all other npcs are precached |
| 2129 | self->e_UseFunc = useF_NPC_VehicleSpawnUse; |
| 2130 | //we're not spawning until later, so precache us now |
| 2131 | BG_VehicleGetIndex( self->NPC_type ); |
| 2132 | } |
| 2133 | else |
| 2134 | { |
| 2135 | G_VehicleSpawn( self ); |
| 2136 | } |
| 2137 | } |
| 2138 | |
| 2139 | //============================================================================================= |
| 2140 | //CHARACTERS |
no test coverage detected