From 9c6a76f2815ec8e4e6f2fbf3837841cc7d253ede Mon Sep 17 00:00:00 2001 From: lemming552 Date: Sun, 22 Jul 2012 20:45:36 -0600 Subject: [PATCH] Fixing a splice action. --- lib/Lacuna/DB/Result/Building.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index 98b10302..e8472c00 100755 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -617,8 +617,9 @@ sub demolish { # Remove the building from the cache my $idx = first_index {$_->id == $self->id} @{$body->building_cache}; if (defined $idx) { - my @buildings = splice @{$body->building_cache},$idx,1; - $body->building_cache(\@buildings); + my @blist = @{$body->building_cache}; + my @buildings = splice @blist,$idx,1; + $body->building_cache(\@blist); } $self->delete; $body->needs_recalc(1); -- 2.51.2