mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Always try to remove a block if it is bonked, even if we can't reclaim an item from it!
This commit is contained in:
parent
d6ca65a44c
commit
2eb7d366d9
@ -1039,13 +1039,13 @@ pub fn handle_bonk(server: &mut Server, pos: Vec3<f32>, owner: Option<Uid>, targ
|
||||
use common::terrain::SpriteKind;
|
||||
let pos = pos.map(|e| e.floor() as i32);
|
||||
if let Some(block) = terrain.get(pos).ok().copied().filter(|b| b.is_bonkable()) {
|
||||
if let Some(item) = comp::Item::try_reclaim_from_block(block) {
|
||||
if block_change
|
||||
.try_set(pos, block.with_sprite(SpriteKind::Empty))
|
||||
.is_some()
|
||||
{
|
||||
drop(terrain);
|
||||
drop(block_change);
|
||||
if block_change
|
||||
.try_set(pos, block.with_sprite(SpriteKind::Empty))
|
||||
.is_some()
|
||||
{
|
||||
drop(terrain);
|
||||
drop(block_change);
|
||||
if let Some(item) = comp::Item::try_reclaim_from_block(block) {
|
||||
server
|
||||
.state
|
||||
.create_object(Default::default(), match block.get_sprite() {
|
||||
@ -1064,7 +1064,7 @@ pub fn handle_bonk(server: &mut Server, pos: Vec3<f32>, owner: Option<Uid>, targ
|
||||
})
|
||||
.build();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user