Don't dismount if we're a steering entity

This commit is contained in:
Maxicarlos08 2024-01-01 13:21:40 +01:00
parent 35fc92f872
commit 004be6395f
No known key found for this signature in database

View File

@ -594,7 +594,10 @@ impl<'a> AgentData<'a> {
tgt_pos: &Pos, tgt_pos: &Pos,
) { ) {
if read_data.is_riders.contains(*self.entity) if read_data.is_riders.contains(*self.entity)
|| read_data.is_volume_riders.contains(*self.entity) || read_data
.is_volume_riders
.get(*self.entity)
.map_or(false, |r| !r.is_steering_entity())
{ {
controller.push_event(ControlEvent::Unmount); controller.push_event(ControlEvent::Unmount);
} }
@ -652,7 +655,10 @@ impl<'a> AgentData<'a> {
const MAX_FLEE_SPEED: f32 = 0.65; const MAX_FLEE_SPEED: f32 = 0.65;
if read_data.is_riders.contains(*self.entity) if read_data.is_riders.contains(*self.entity)
|| read_data.is_volume_riders.contains(*self.entity) || read_data
.is_volume_riders
.get(*self.entity)
.map_or(false, |r| !r.is_steering_entity())
{ {
controller.push_event(ControlEvent::Unmount); controller.push_event(ControlEvent::Unmount);
} }