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

Function BOA_HasPossibleBlockage

Descent3/BOA.cpp:495–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495bool BOA_HasPossibleBlockage(int start_room, int end_room) {
496 int s_index = start_room;
497 int e_index = end_room;
498
499 if (start_room == -1 || end_room == -1) {
500 return false;
501 }
502
503 if ((!ROOMNUM_OUTSIDE(s_index)) && s_index <= Highest_room_index) {
504 if (!Rooms[s_index].used) {
505 return false;
506 }
507 } else if (ROOMNUM_OUTSIDE(s_index)) {
508 s_index = TERRAIN_REGION(start_room) + Highest_room_index + 1;
509 } else {
510 ASSERT(s_index <= Highest_room_index + MAX_BOA_TERRAIN_REGIONS);
511 }
512
513 if ((!ROOMNUM_OUTSIDE(e_index)) && e_index <= Highest_room_index) {
514 if (!Rooms[e_index].used) {
515 return false;
516 }
517 } else if (ROOMNUM_OUTSIDE(e_index)) {
518 e_index = TERRAIN_REGION(end_room) + Highest_room_index + 1;
519 } else {
520 ASSERT(e_index <= Highest_room_index + MAX_BOA_TERRAIN_REGIONS);
521 }
522
523 return ((BOA_Array[s_index][e_index] & BOAF_BLOCKAGE) != 0);
524}
525bool BOA_IsVisible(int start_room, int end_room) {
526 int s_index = start_room;
527 int e_index = end_room;

Callers 1

AIPathAllocPathFunction · 0.85

Calls 1

TERRAIN_REGIONFunction · 0.85

Tested by

no test coverage detected