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

Function cMalfunctionRegionDoors

scripts/merc5.cpp:886–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884 }};
885
886void cMalfunctionRegionDoors(int region) {
887 int i;
888
889 i = 0;
890 while (strcmp(Region_door_names[region][i], "End") != 0) {
891 int rnum = rand() % 100;
892 if (rnum < 50) {
893 int doorref = Scrpt_FindDoorName(Region_door_names[region][i]);
894 if (doorref != OBJECT_HANDLE_NONE) {
895 if (rnum >= 30 && rnum < 50) {
896 aDoorActivate(doorref);
897 } else if (rnum >= 10 && rnum < 30) {
898 rnum = rand() % 20;
899 aDoorSetPos(doorref, 0.55f + (rnum * 0.01f));
900 } else {
901 aDoorStop(doorref);
902 }
903 }
904 }
905 i++;
906 }
907}
908
909/*
910$$ACTION

Callers 1

CallEventMethod · 0.85

Calls 3

aDoorActivateFunction · 0.85
aDoorSetPosFunction · 0.85
aDoorStopFunction · 0.85

Tested by

no test coverage detected