Make mounted NPC properly utilize their free will

This commit is contained in:
Isse 2026-07-14 10:15:30 +02:00
parent 55322470e5
commit d806b72062
2 changed files with 7 additions and 2 deletions

View file

@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix Orientation of Wildskin Drum's Thumbnail
- Fast river sfx
- All NPCs don't go to bed & wake up at the same time.
- Mounted NPC can now properly utilize their free will.
## [0.18.0] - 2026-01-23

View file

@ -68,7 +68,7 @@ impl<'a> System<'a> for Sys {
read_data.groups.maybe(),
read_data.rtsim_actors.maybe(),
(
!&read_data.is_mounts,
read_data.is_mounts.maybe(),
read_data.is_riders.maybe(),
read_data.is_volume_riders.maybe(),
),
@ -94,11 +94,15 @@ impl<'a> System<'a> for Sys {
light_emitter,
group,
rtsim_actor,
(_, is_rider, is_volume_rider),
(is_mount, is_rider, is_volume_rider),
)| {
let mut emitters = events.get_emitters();
let mut rng = rng();
if is_mount.is_some() && body.is_none_or(|body| !body.has_free_will()) {
return;
}
// The entity that is moving, if riding it's the mount, otherwise it's itself
let moving_entity = is_rider
.and_then(|is_rider| {