MCPcopy Create free account
hub / github.com/JACoders/OpenJK / NPC_Spawn

Function NPC_Spawn

code/game/NPC_spawn.cpp:1874–1904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1872*/
1873
1874void NPC_Spawn ( gentity_t *ent, gentity_t *other, gentity_t *activator )
1875{
1876 //delay before spawning NPC
1877 if (other->spawnflags&32)
1878 {
1879 ent->enemy = activator;
1880 }
1881 if( ent->delay )
1882 {
1883/* //Stasis does an extra step
1884 if ( Q_stricmp( ent->classname, "NPC_Stasis" ) == 0 )
1885 {
1886 if ( NPC_StasisSpawn_Go( ent ) == qfalse )
1887 return;
1888 }
1889*/
1890 if ( ent->spawnflags & 2048 ) // SHY
1891 ent->e_ThinkFunc = thinkF_NPC_ShySpawn;
1892 else
1893 ent->e_ThinkFunc = thinkF_NPC_Spawn_Go;
1894
1895 ent->nextthink = level.time + ent->delay;
1896 }
1897 else
1898 {
1899 if ( ent->spawnflags & 2048 ) // SHY
1900 NPC_ShySpawn( ent );
1901 else
1902 NPC_Spawn_Go( ent );
1903 }
1904}
1905
1906/*QUAKED NPC_spawner (1 0 0) (-16 -16 -24) (16 16 40) x x x x DROPTOFLOOR CINEMATIC NOTSOLID STARTINSOLID SHY SAFE
1907

Callers 2

SP_NPC_spawnerFunction · 0.70
NPC_Spawn_fFunction · 0.70

Calls 2

NPC_ShySpawnFunction · 0.70
NPC_Spawn_GoFunction · 0.70

Tested by

no test coverage detected