mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'xvar/fix-loot-drop-crash' into 'master'
Added temporary fix to prevent loot drops causing a server crash See merge request veloren/veloren!3416
This commit is contained in:
commit
a3f6b79420
@ -447,6 +447,10 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, last_change: Healt
|
||||
let pos = state.ecs().read_storage::<comp::Pos>().get(entity).cloned();
|
||||
let vel = state.ecs().read_storage::<comp::Vel>().get(entity).cloned();
|
||||
if let Some(pos) = pos {
|
||||
// TODO: Figure out how damage contributions of 0% are being awarded - for now
|
||||
// just remove them to avoid a crash when creating the WeightedIndex
|
||||
let _ = exp_awards.drain_filter(|(_, exp)| *exp < f32::EPSILON);
|
||||
|
||||
let winner_uid = if exp_awards.is_empty() {
|
||||
None
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user