fix the bus dropping you off right into the sun /o\

This commit is contained in:
yuni 2024-04-20 03:26:35 +02:00
parent 7e56f1f07b
commit 2c44d89c53

View file

@ -778,6 +778,7 @@ pub fn handle_chat_scripts(
mut q_playercam: Query<(&mut Position, &mut LinearVelocity), With<actor::PlayerCamera>>, mut q_playercam: Query<(&mut Position, &mut LinearVelocity), With<actor::PlayerCamera>>,
mut ew_sfx: EventWriter<audio::PlaySfxEvent>, mut ew_sfx: EventWriter<audio::PlaySfxEvent>,
mut ew_effect: EventWriter<effects::SpawnEffectEvent>, mut ew_effect: EventWriter<effects::SpawnEffectEvent>,
id2pos: Res<actor::Id2Pos>,
) { ) {
for script in er_chatscript.read() { for script in er_chatscript.read() {
// Parse the script string // Parse the script string
@ -834,19 +835,20 @@ pub fn handle_chat_scripts(
} }
else { else {
if let Ok((mut pos, mut v)) = q_playercam.get_single_mut() { if let Ok((mut pos, mut v)) = q_playercam.get_single_mut() {
if param1 == "oscillation".to_string() { let busstop = match param1 {
*pos = Position(DVec3::new(-184968e3, 149410e3, -134273e3)); "serenity" => Some("busstop"),
v.0 = DVec3::ZERO; "oscillation" => Some("busstop2"),
} "metisprime" => Some("busstop3"),
else if param1 == "metisprime".to_string() { _ => None
*pos = Position(DVec3::new(27643e3, -47e3, -124434e3)); };
v.0 = DVec3::ZERO; if let Some(station) = busstop {
} if let Some(target) = id2pos.0.get(&station.to_string()) {
else if param1 == "serenity".to_string() { pos.0 = *target + DVec3::new(0.0, -1000.0, 0.0);
*pos = Position(DVec3::new(-121095e3, 582e3, -190816e3)); v.0 = DVec3::ZERO;
v.0 = DVec3::ZERO; } else {
} error!("Could not determine position of actor with ID: '{}'", station);
else { }
} else {
error!("Invalid destination for cryotrip chat script: '{}'", param1); error!("Invalid destination for cryotrip chat script: '{}'", param1);
} }
} }