| 1515 | } |
| 1516 | |
| 1517 | Point GetRndObjLoc(int randarea) |
| 1518 | { |
| 1519 | if (randarea == 0) |
| 1520 | return { 0, 0 }; |
| 1521 | |
| 1522 | int tries = 0; |
| 1523 | int x; |
| 1524 | int y; |
| 1525 | while (true) { |
| 1526 | tries++; |
| 1527 | if (tries > 1000 && randarea > 1) |
| 1528 | randarea--; |
| 1529 | x = GenerateRnd(MAXDUNX); |
| 1530 | y = GenerateRnd(MAXDUNY); |
| 1531 | bool failed = false; |
| 1532 | for (int i = 0; i < randarea && !failed; i++) { |
| 1533 | for (int j = 0; j < randarea && !failed; j++) { |
| 1534 | failed = !RndLocOk(i + x, j + y); |
| 1535 | } |
| 1536 | } |
| 1537 | if (!failed) |
| 1538 | break; |
| 1539 | } |
| 1540 | return { x, y }; |
| 1541 | } |
| 1542 | |
| 1543 | void AddMushPatch() |
| 1544 | { |
no test coverage detected