mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Renamed emit_alarm to emit_scream
This commit is contained in:
parent
2b36a957ac
commit
8099b516a9
@ -716,7 +716,7 @@ impl<'a> AgentData<'a> {
|
|||||||
// Should the agent flee?
|
// Should the agent flee?
|
||||||
if agent.action_state.timer == 0.0 && can_speak(agent) {
|
if agent.action_state.timer == 0.0 && can_speak(agent) {
|
||||||
self.chat_general("npc.speech.villager_under_attack", event_emitter);
|
self.chat_general("npc.speech.villager_under_attack", event_emitter);
|
||||||
self.emit_alarm(read_data.time.0, event_emitter);
|
self.emit_scream(read_data.time.0, event_emitter);
|
||||||
agent.action_state.timer = 0.01;
|
agent.action_state.timer = 0.01;
|
||||||
} else if agent.action_state.timer < FLEE_DURATION
|
} else if agent.action_state.timer < FLEE_DURATION
|
||||||
|| dist_sq < MAX_FLEE_DIST.powi(2)
|
|| dist_sq < MAX_FLEE_DIST.powi(2)
|
||||||
@ -4355,7 +4355,7 @@ impl<'a> AgentData<'a> {
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn emit_alarm(&self, time: f64, event_emitter: &mut Emitter<'_, ServerEvent>) {
|
fn emit_scream(&self, time: f64, event_emitter: &mut Emitter<'_, ServerEvent>) {
|
||||||
if let Some(body) = self.body {
|
if let Some(body) = self.body {
|
||||||
event_emitter.emit(ServerEvent::Sound {
|
event_emitter.emit(ServerEvent::Sound {
|
||||||
sound: Sound::new(
|
sound: Sound::new(
|
||||||
|
Loading…
Reference in New Issue
Block a user