diff --git a/common/src/cmd.rs b/common/src/cmd.rs index e301491242..0e9c18bebd 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -461,7 +461,7 @@ impl ServerChatCommand { Float("x", 0.0, Required), Float("y", 0.0, Required), Float("z", 0.0, Required), - Boolean("Force from ship", "true".to_string(), Optional), + Boolean("Dismount from ship", "true".to_string(), Optional), ], "Teleport to a position", Some(Admin), @@ -506,7 +506,7 @@ impl ServerChatCommand { Float("x", 0.0, Required), Float("y", 0.0, Required), Float("z", 0.0, Required), - Boolean("Force from ship", "true".to_string(), Optional), + Boolean("Dismount from ship", "true".to_string(), Optional), ], "Offset your current position", Some(Admin), @@ -641,7 +641,7 @@ impl ServerChatCommand { ServerChatCommand::Site => cmd( vec![ SiteName(Required), - Boolean("Force from ship", "true".to_string(), Optional), + Boolean("Dismount from ship", "true".to_string(), Optional), ], "Teleport to a site", Some(Moderator), @@ -688,7 +688,7 @@ impl ServerChatCommand { ServerChatCommand::Tp => cmd( vec![ PlayerName(Optional), - Boolean("Force from ship", "true".to_string(), Optional), + Boolean("Dismount from ship", "true".to_string(), Optional), ], "Teleport to another player", Some(Moderator), @@ -696,7 +696,7 @@ impl ServerChatCommand { ServerChatCommand::RtsimTp => cmd( vec![ Integer("npc index", 0, Required), - Boolean("Force from ship", "true".to_string(), Optional), + Boolean("Dismount from ship", "true".to_string(), Optional), ], "Teleport to an rtsim npc", Some(Moderator), diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 05463e9bc9..b8faaa8f64 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -227,10 +227,10 @@ fn position_mut( server: &mut Server, entity: EcsEntity, descriptor: &str, - force_from_volume: Option, + dismount_volume: Option, f: impl for<'a> FnOnce(&'a mut comp::Pos) -> T, ) -> CmdResult { - let entity = if force_from_volume.unwrap_or(true) { + let entity = if dismount_volume.unwrap_or(true) { server .state .ecs() @@ -855,10 +855,9 @@ fn handle_jump( args: Vec, action: &ServerChatCommand, ) -> CmdResult<()> { - if let (Some(x), Some(y), Some(z), force_from_volume) = - parse_cmd_args!(args, f32, f32, f32, bool) + if let (Some(x), Some(y), Some(z), dismount_volume) = parse_cmd_args!(args, f32, f32, f32, bool) { - position_mut(server, target, "target", force_from_volume, |current_pos| { + position_mut(server, target, "target", dismount_volume, |current_pos| { current_pos.0 += Vec3::new(x, y, z) }) } else { @@ -873,10 +872,9 @@ fn handle_goto( args: Vec, action: &ServerChatCommand, ) -> CmdResult<()> { - if let (Some(x), Some(y), Some(z), force_from_volume) = - parse_cmd_args!(args, f32, f32, f32, bool) + if let (Some(x), Some(y), Some(z), dismount_volume) = parse_cmd_args!(args, f32, f32, f32, bool) { - position_mut(server, target, "target", force_from_volume, |current_pos| { + position_mut(server, target, "target", dismount_volume, |current_pos| { current_pos.0 = Vec3::new(x, y, z) }) } else { @@ -894,7 +892,7 @@ fn handle_site( action: &ServerChatCommand, ) -> CmdResult<()> { #[cfg(feature = "worldgen")] - if let (Some(dest_name), force_from_volume) = parse_cmd_args!(args, String, bool) { + if let (Some(dest_name), dismount_volume) = parse_cmd_args!(args, String, bool) { let site = server .world .civs() @@ -911,7 +909,7 @@ fn handle_site( false, ); - position_mut(server, target, "target", force_from_volume, |current_pos| { + position_mut(server, target, "target", dismount_volume, |current_pos| { current_pos.0 = site_pos }) } else { @@ -1235,7 +1233,7 @@ fn handle_tp( args: Vec, action: &ServerChatCommand, ) -> CmdResult<()> { - let (player, force_from_volume) = parse_cmd_args!(args, String, bool); + let (player, dismount_volume) = parse_cmd_args!(args, String, bool); let player = if let Some(alias) = player { find_alias(server.state.ecs(), &alias)?.0 } else if client != target { @@ -1244,7 +1242,7 @@ fn handle_tp( return Err(action.help_string()); }; let player_pos = position(server, player, "player")?; - position_mut(server, target, "target", force_from_volume, |target_pos| { + position_mut(server, target, "target", dismount_volume, |target_pos| { *target_pos = player_pos }) } @@ -1257,7 +1255,7 @@ fn handle_rtsim_tp( action: &ServerChatCommand, ) -> CmdResult<()> { use crate::rtsim::RtSim; - let (npc_index, force_from_volume) = parse_cmd_args!(args, u32, bool); + let (npc_index, dismount_volume) = parse_cmd_args!(args, u32, bool); let pos = if let Some(id) = npc_index { // TODO: Take some other identifier than an integer to this command. server @@ -1274,7 +1272,7 @@ fn handle_rtsim_tp( } else { return Err(action.help_string()); }; - position_mut(server, target, "target", force_from_volume, |target_pos| { + position_mut(server, target, "target", dismount_volume, |target_pos| { target_pos.0 = pos; }) } diff --git a/voxygen/src/mesh/segment.rs b/voxygen/src/mesh/segment.rs index b723b3ec4b..32d27ee380 100644 --- a/voxygen/src/mesh/segment.rs +++ b/voxygen/src/mesh/segment.rs @@ -56,11 +56,7 @@ where let draw_delta = lower_bound; let get_light = |vol: &mut V, pos: Vec3| { - if vol.get(pos).map_or(true, |vox| !vox.is_filled()) { - 1.0 - } else { - 0.0 - } + vol.get(pos).map_or(true, |vox| !vox.is_filled()) as i32 as f32 }; let get_glow = |_vol: &mut V, _pos: Vec3| 0.0; let get_opacity = @@ -302,13 +298,8 @@ where let greedy_size_cross = greedy_size; let draw_delta = Vec3::new(1, 1, 1); - let get_light = move |flat: &mut _, pos: Vec3| { - if !flat_get(flat, pos).is_filled() { - 1.0 - } else { - 0.0 - } - }; + let get_light = + move |flat: &mut _, pos: Vec3| !flat_get(flat, pos).is_filled() as i32 as f32; let get_glow = |_flat: &mut _, _pos: Vec3| 0.0; let get_color = move |flat: &mut _, pos: Vec3| { flat_get(flat, pos).get_color().unwrap_or_else(Rgb::zero) @@ -390,11 +381,7 @@ where let draw_delta = lower_bound; let get_light = |vol: &mut V, pos: Vec3| { - if vol.get(pos).map_or(true, |vox| !vox.is_filled()) { - 1.0 - } else { - 0.0 - } + vol.get(pos).map_or(true, |vox| !vox.is_filled()) as i32 as f32 }; let get_glow = |_vol: &mut V, _pos: Vec3| 0.0; let get_color = |vol: &mut V, pos: Vec3| {