MCPcopy Create free account
hub / github.com/diasurgical/devilution / DoPatternCheck

Function DoPatternCheck

Source/drlg_l2.cpp:923–992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

921}
922
923static void DoPatternCheck(int i, int j)
924{
925 int k, l, x, y, nOk;
926
927 for (k = 0; Patterns[k][4] != 255; k++) {
928 x = i - 1;
929 y = j - 1;
930 nOk = 254;
931 for (l = 0; l < 9 && nOk == 254; l++) {
932 nOk = 255;
933 if (l == 3 || l == 6) {
934 y++;
935 x = i - 1;
936 }
937 if (x >= 0 && x < DMAXX && y >= 0 && y < DMAXY) {
938 switch (Patterns[k][l]) {
939 case 0:
940 nOk = 254;
941 break;
942 case 1:
943 if (predungeon[x][y] == 35) {
944 nOk = 254;
945 }
946 break;
947 case 2:
948 if (predungeon[x][y] == 46) {
949 nOk = 254;
950 }
951 break;
952 case 4:
953 if (predungeon[x][y] == 32) {
954 nOk = 254;
955 }
956 break;
957 case 3:
958 if (predungeon[x][y] == 68) {
959 nOk = 254;
960 }
961 break;
962 case 5:
963 if (predungeon[x][y] == 68 || predungeon[x][y] == 46) {
964 nOk = 254;
965 }
966 break;
967 case 6:
968 if (predungeon[x][y] == 68 || predungeon[x][y] == 35) {
969 nOk = 254;
970 }
971 break;
972 case 7:
973 if (predungeon[x][y] == 32 || predungeon[x][y] == 46) {
974 nOk = 254;
975 }
976 break;
977 case 8:
978 if (predungeon[x][y] == 68 || predungeon[x][y] == 35 || predungeon[x][y] == 46) {
979 nOk = 254;
980 }

Callers 1

CreateDungeonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected