Fix 18-slot pets (they now properly get inventories based on their body type, which is usually 1-slot).

Also fixes a related issue where pets lose their natural weapons/armour.
This commit is contained in:
Avi Weinstock
2022-09-22 16:08:39 -04:00
parent 60f5383f8b
commit ff781198d3
3 changed files with 8 additions and 3 deletions

View File

@ -26,7 +26,7 @@ use common::{
resources::{Time, TimeOfDay},
slowjob::SlowJobPool,
uid::{Uid, UidAllocator},
ViewDistances,
LoadoutBuilder, ViewDistances,
};
use common_net::{
msg::{CharacterInfo, PlayerListUpdate, PresenceKind, ServerGeneral},
@ -651,7 +651,10 @@ impl StateExt for State {
comp::SkillSet::default(),
Some(comp::Health::new(body, DEFAULT_PET_HEALTH_LEVEL)),
Poise::new(body),
Inventory::with_empty(),
Inventory::with_loadout(
LoadoutBuilder::from_default(&body).build(),
body,
),
body,
)
.with(comp::Scale(1.0))