veloren/common
juliancoffee 5f3eaddb70 Split LodoutBuilder::build_loadout
LoadoutBuilder::build_loadout is a function which has four parameters
and 3 of them are Option<>, and although fourth (body) isn't Option<>,
it's optional too because it is used only in some combinations of
another arguments.

Because these combinations produces quirky code flow, it will be better
to split it to different methods.

So we did following changes to remove it and rewrite code that was using it
to use better methods.

* Introduce LoadoutPreset as new LoadoutConfig, currently it's only used
in Summon ability, because SummonInfo uses Copy and we can't specify
String for specifying asset path for loadout.
Everything else is rewritten to use asset path to create loadouts.

* More builder methods for LoadoutBuilder.
Namely:
    - from_default which is used in server/src/cmd.rs in "/spawn" command.
    - with_default_equipment, with_default_maintool to use default
    loadout for specific body
    - with_preset to use LoadoutPreset

* Add new make_loadout field with `fn (loadout_builder, trading_info) -> loadout_builder`
to EntityInfo which allows to lazily construct loadout without
modifying LoadoutBuilder code

* Fix Merchants not having trade site
We had heuristic that if something has Merchant LoadoutConfig - it's
merchant, which can be false, especially if we create Merchant loadout
lazily
As side note, we do same check for Guards and it fails too.

Too fix it, we introduce new agent::Mark, which explicitly specifies
kind of agent for entity

* `LoadoutBuilder::build_loadout` was written in a such way that depending
on main_tool you will have different loadout. Turns out it was this
way only for Adlets though and this behaviour is reproduced by specifying
different loadouts directly in world code.
2021-06-09 15:37:04 +03:00
..
assets serialize AssetTweakWrapper<T>, not just T 2021-06-08 22:39:51 +03:00
base Fix ProfSpan constructor being private 2021-06-03 00:10:06 -04:00
benches use criterion groups and fix tracing to much on wgpu 2021-06-03 22:37:17 +02:00
ecs switch to hashbrown 0.11 and specs 0.16.2 2021-06-07 13:01:01 +02:00
frontend adjust tracing 2021-06-06 19:31:25 +02:00
net switch to hashbrown 0.11 and specs 0.16.2 2021-06-07 13:01:01 +02:00
src Split LodoutBuilder::build_loadout 2021-06-09 15:37:04 +03:00
state switch to hashbrown 0.11 and specs 0.16.2 2021-06-07 13:01:01 +02:00
systems switch to hashbrown 0.11 and specs 0.16.2 2021-06-07 13:01:01 +02:00
build.rs fix and improve nix build: actually output a proper veloren voxygen package now 2020-11-25 02:00:50 +03:00
Cargo.toml Add graphviz diagram generator for crafting recipes. 2021-06-08 14:42:51 -04:00