* Perform residential immigration into the current residential tile. * @param pos Position of the tile. * @param pop Population ? * @param value Land value corrected for pollution. */
| 598 | * @param value Land value corrected for pollution. |
| 599 | */ |
| 600 | void Micropolis::doResIn(const Position &pos, int pop, int value) |
| 601 | { |
| 602 | short pollution = pollutionDensityMap.worldGet(pos.posX, pos.posY); |
| 603 | |
| 604 | if (pollution > 128) { |
| 605 | return; |
| 606 | } |
| 607 | |
| 608 | MapTile tile = map[pos.posX][pos.posY] & LOMASK; |
| 609 | |
| 610 | if (tile == FREEZ) { |
| 611 | |
| 612 | if (pop < 8) { |
| 613 | buildHouse(pos, value); |
| 614 | incRateOfGrowth(pos, 1); |
| 615 | return; |
| 616 | } |
| 617 | |
| 618 | if (populationDensityMap.worldGet(pos.posX, pos.posY) > 64) { |
| 619 | resPlop(pos, 0, value); |
| 620 | incRateOfGrowth(pos, 8); |
| 621 | return; |
| 622 | } |
| 623 | |
| 624 | return; |
| 625 | } |
| 626 | |
| 627 | if (pop < 40) { |
| 628 | resPlop(pos, (pop / 8) - 1, value); |
| 629 | incRateOfGrowth(pos, 8); |
| 630 | } |
| 631 | |
| 632 | } |
| 633 | |
| 634 | |
| 635 | /** |