| 505 | } |
| 506 | |
| 507 | void Terrain::RemovePatch(const Int2& patchCoord) |
| 508 | { |
| 509 | const auto patch = GetPatch(patchCoord); |
| 510 | if (patch == nullptr) |
| 511 | { |
| 512 | LOG(Warning, "Cannot remove patch at {0}x{1}. It does not exist.", patchCoord.X, patchCoord.Y); |
| 513 | return; |
| 514 | } |
| 515 | |
| 516 | ::Delete(patch); |
| 517 | _patches.Remove(patch); |
| 518 | |
| 519 | CacheNeighbors(); |
| 520 | |
| 521 | if (IsDuringPlay()) |
| 522 | { |
| 523 | UpdateBounds(); |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | #endif |
| 528 |