MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / osipf_AIGetRoomPathPoint

Function osipf_AIGetRoomPathPoint

Descent3/osiris_predefs.cpp:1979–1998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1977}
1978
1979vector osipf_AIGetRoomPathPoint(int roomnum) {
1980 if (ROOMNUM_OUTSIDE(roomnum)) {
1981 int cell = CELLNUM(roomnum);
1982
1983 if (cell >= TERRAIN_DEPTH * TERRAIN_WIDTH) {
1984 return Zero_vector;
1985 } else {
1986 vector pos;
1987
1988 ComputeTerrainSegmentCenter(&pos, cell);
1989 pos.y += 15.0f + ((float)ps_rand() / (float)D3_RAND_MAX) * 20; // between 15 and 35
1990
1991 return pos;
1992 }
1993 } else if (roomnum <= Highest_room_index && Rooms[roomnum].used) {
1994 return Rooms[roomnum].path_pnt;
1995 }
1996
1997 return Zero_vector;
1998}
1999
2000int osipf_AIFindEnergyCenter(int objhandle) {
2001 object *obj = ObjGet(objhandle);

Callers

nothing calls this directly

Calls 2

ps_randFunction · 0.85

Tested by

no test coverage detected