fix instant death when teleporting with dev mode but no god mode

This commit is contained in:
yuni 2024-10-03 06:11:27 +02:00
parent 26ec38e9ce
commit f135122dc7

View file

@ -414,6 +414,7 @@ fn handle_cheats(
} }
if key_input.just_pressed(settings.key_cheat_teleport) { if key_input.just_pressed(settings.key_cheat_teleport) {
if let Ok((transform, target_pos, target_v)) = q_target.get_single() { if let Ok((transform, target_pos, target_v)) = q_target.get_single() {
gforce.ignore_gforce_seconds = 1.0;
let offset: DVec3 = let offset: DVec3 =
4.0 * (**pos - **target_pos).normalize() * transform.scale.as_dvec3(); 4.0 * (**pos - **target_pos).normalize() * transform.scale.as_dvec3();
pos.0 = **target_pos + offset; pos.0 = **target_pos + offset;