Move neutral agent block above enemy block

This commit is contained in:
holychowders 2021-05-23 15:38:39 -07:00 committed by Avi Weinstock
parent c2239daaa0
commit ad4bca3e52

View File

@ -3870,6 +3870,14 @@ impl<'a> AgentData<'a> {
// TODO: Change this to a search action instead of idle
self.idle(agent, controller, &read_data);
}
} else if is_village_guard {
let sound_is_villager_alarm = matches!(sound.kind, SoundKind::VillagerAlarm);
if sound_is_villager_alarm {
self.follow(agent, controller, &read_data.terrain, &sound_pos);
} else {
self.idle(agent, controller, &read_data);
}
} else if is_neutral {
let aggro = agent.psyche.aggro;
let close_enough = dist_sqrd < 35.0_f32.powi(2);
@ -3880,14 +3888,6 @@ impl<'a> AgentData<'a> {
} else {
self.idle(agent, controller, read_data);
}
} else if is_village_guard {
let sound_is_villager_alarm = matches!(sound.kind, SoundKind::VillagerAlarm);
if sound_is_villager_alarm {
self.follow(agent, controller, &read_data.terrain, &sound_pos);
} else {
self.idle(agent, controller, &read_data);
}
} else {
// TODO: Change this to a search action instead of idle
self.idle(agent, controller, read_data);