+sub replace {
+ my $self = shift;
+ my $old = shift || $self->replace_old;
+ # editing the tower location needs to regenerate coverage on its sectors
+ my $regen_coverage = 0;
+ foreach (qw(latitude longitude height)) {
+ $regen_coverage = 1 if $self->get($_) != $old->get($_);
+ }
+
+ my $error = $self->SUPER::replace($old);
+ return $error if $error;
+
+ if ($regen_coverage) {
+ foreach my $sector ($self->tower_sector) {
+ $sector->queue_generate_coverage;
+ }
+ }
+}