--- deliantra/server/ext/cfplus_build.ext 2006/12/15 19:29:18 1.1 +++ deliantra/server/ext/cfplus_build.ext 2006/12/20 12:09:35 1.2 @@ -59,11 +59,11 @@ if ($msg->{do_erase}) { if ($pl->ob->flag (cf::FLAG_WIZ)) { my ($top) = reverse $pl->ob->map->at ($x, $y); - $top->destroy if $top; + $top->destroy if ($top and $top->flag (cf::FLAG_IS_BUILDABLE)); } else { for my $ob ($pl->ob->map->at ($x, $y)) { - unless ($ob->type == cf::WALL || $ob->type == cf::FLOOR || $ob->flag (cf::FLAG_IS_FLOOR)) { - $ob->destroy; + unless ($ob->type == cf::BUILDABLE_WALL || $ob->type == cf::FLOOR || $ob->flag (cf::FLAG_IS_FLOOR)) { + $ob->destroy if $ob->flag (cf::FLAG_IS_BUILDABLE); } } } @@ -77,7 +77,7 @@ if ($arch->clone->subtype == cf::ST_MAT_FLOOR) { my $above_floor; for my $ob ($pl->ob->map->at ($x, $y)) { - if ($ob->type == cf::WALL) { + if ($ob->type == cf::BUILDABLE_WALL) { undef $above_floor if $above_floor == $ob; $ob->destroy; } elsif ($ob->type == cf::FLOOR || $ob->flag (cf::FLAG_IS_FLOOR)) { @@ -100,7 +100,7 @@ my @obs = $pl->ob->map->at ($x, $y); my $prev_wall; for (@obs) { - if ($_->type == cf::WALL) { + if ($_->type == cf::BUILDABLE_WALL) { $prev_wall = $_; last; } @@ -116,7 +116,7 @@ } my $wall = cf::object::new $arch->clone->slaying; - $wall->type (cf::WALL); + $wall->type (cf::BUILDABLE_WALL); $wall->flag (cf::FLAG_IS_BUILDABLE, 1); $wall->insert_ob_in_map_at ($pl->ob->map, undef, cf::INS_ABOVE_FLOOR_ONLY, $x, $y); if ($prev_wall) {