mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed migration to properly insert components in the correct position. Fixed small error in how names were generated for any modular weapon that used the held component as its main component.
This commit is contained in:
parent
a908eb5791
commit
01450b7e34
@ -274,13 +274,13 @@ pub(super) fn synthesize_modular_asset(specifier: &str) -> Option<RawItemDef> {
|
||||
pub(super) fn modular_name<'a>(item: &'a Item, arg1: &'a str) -> Cow<'a, str> {
|
||||
match item.kind() {
|
||||
ItemKind::Tool(tool) => {
|
||||
let damage_components = item.components().iter().filter(|comp| {
|
||||
let main_components = item.components().iter().filter(|comp| {
|
||||
matches!(comp.kind(), ItemKind::ModularComponent(ModularComponent { modkind, .. })
|
||||
if matches!(modkind, ModularComponentKind::Damage)
|
||||
if *modkind == ModularComponentKind::main_component(tool.kind)
|
||||
)
|
||||
});
|
||||
// Last fine as there should only ever be one damage component on a weapon
|
||||
let (material_name, weapon_name) = if let Some(component) = damage_components.last() {
|
||||
let (material_name, weapon_name) = if let Some(component) = main_components.last() {
|
||||
let materials =
|
||||
component
|
||||
.components()
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user