diff --git a/common/src/bin/csv_export/main.rs b/common/src/bin/csv_export/main.rs index 21bf6eec6c..29fc94815d 100644 --- a/common/src/bin/csv_export/main.rs +++ b/common/src/bin/csv_export/main.rs @@ -278,14 +278,13 @@ fn loot_table(loot_table: &str) -> Result<(), Box> { fn entity_drops(entity_config: &str) -> Result<(), Box> { let mut wtr = csv::Writer::from_path("drop_table.csv")?; + wtr.write_record(&["Entity Path", "Percent Chance", "Item Path", "Quantity"])?; fn write_entity_loot( wtr: &mut csv::Writer, asset_path: &str, ) -> Result<(), Box> { - wtr.write_record(&["Percent Chance", "Item Path", "Quantity"])?; - - let entity_config = EntityConfig::load_expect(&asset_path).read(); + let entity_config = EntityConfig::load_expect(asset_path).read(); // Create initial entry in drop table let entry: (f32, LootSpec) = (1.0, entity_config.loot.clone()); @@ -362,7 +361,8 @@ fn entity_drops(entity_config: &str) -> Result<(), Box> { let (item_asset, quantity) = match item { LootSpec::Item(item) => (Some(item), "1".to_string()), LootSpec::ItemQuantity(item, lower, upper) => { - (Some(item), format!("{}-{}", lower, upper)) + // Tab needed so excel doesn't think it is a date... + (Some(item), format!("{}-{}\t", lower, upper)) }, LootSpec::LootTable(_) => panic!("Shouldn't exist"), LootSpec::Nothing => (None, "-".to_string()), @@ -376,7 +376,7 @@ fn entity_drops(entity_config: &str) -> Result<(), Box> { "Nothing" }; - wtr.write_record(&[&percent_chance, item_name, &quantity])? + wtr.write_record(&[asset_path, &percent_chance, item_name, &quantity])? } Ok(()) @@ -387,7 +387,6 @@ fn entity_drops(entity_config: &str) -> Result<(), Box> { .expect("Entity files moved somewhere else maybe?") .ids(); for config in configs { - wtr.write_record(&[config, "", ""])?; write_entity_loot(&mut wtr, config)?; } } else {