* Copy the value of #powerGridMap at position \a pos to the map. * @param pos Position to copy. * @return Does the tile have power? */
| 417 | * @return Does the tile have power? |
| 418 | */ |
| 419 | bool Micropolis::setZonePower(const Position &pos) |
| 420 | { |
| 421 | MapValue mapValue = map[pos.posX][pos.posY]; |
| 422 | MapTile tile = mapValue & LOMASK; |
| 423 | |
| 424 | if (tile == NUCLEAR || tile == POWERPLANT) { |
| 425 | map[pos.posX][pos.posY] = mapValue | PWRBIT; |
| 426 | return true; |
| 427 | } |
| 428 | |
| 429 | if (powerGridMap.worldGet(pos.posX, pos.posY)) { |
| 430 | map[pos.posX][pos.posY] = mapValue | PWRBIT; |
| 431 | return true; |
| 432 | } else { |
| 433 | map[pos.posX][pos.posY] = mapValue & (~PWRBIT); |
| 434 | return false; |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | |
| 439 | /** |