| 1839 | #define SHY_SPAWN_DISTANCE_SQR ( SHY_SPAWN_DISTANCE * SHY_SPAWN_DISTANCE ) |
| 1840 | |
| 1841 | void NPC_ShySpawn( gentity_t *ent ) |
| 1842 | { |
| 1843 | ent->nextthink = level.time + SHY_THINK_TIME; |
| 1844 | ent->e_ThinkFunc = thinkF_NPC_ShySpawn; |
| 1845 | |
| 1846 | if ( DistanceSquared( g_entities[0].currentOrigin, ent->currentOrigin ) <= SHY_SPAWN_DISTANCE_SQR ) |
| 1847 | return; |
| 1848 | |
| 1849 | if ( (InFOV( ent, &g_entities[0], 80, 64 )) ) // FIXME: hardcoded fov |
| 1850 | if ( (NPC_ClearLOS( &g_entities[0], ent->currentOrigin )) ) |
| 1851 | return; |
| 1852 | |
| 1853 | // 4/18/03 kef -- don't let guys spawn into other guys |
| 1854 | if (ent->spawnflags & 4096) |
| 1855 | { |
| 1856 | if (!NPC_SafeSpawn(ent, 64)) |
| 1857 | { |
| 1858 | return; |
| 1859 | } |
| 1860 | } |
| 1861 | |
| 1862 | ent->e_ThinkFunc = thinkF_NULL; |
| 1863 | ent->nextthink = 0; |
| 1864 | |
| 1865 | NPC_Spawn_Go( ent ); |
| 1866 | } |
| 1867 | |
| 1868 | /* |
| 1869 | ------------------------- |
no test coverage detected