Fix typos

This commit is contained in:
tygyh 2022-07-15 18:59:37 +02:00
parent abdd5e3906
commit 120ee6b6c0
61 changed files with 113 additions and 112 deletions

View File

@ -162,7 +162,7 @@ impl WeatherLerp {
self.old = mem::replace(&mut self.new, (weather, Instant::now()));
}
// TODO: Make impprovements to this interpolation, it's main issue is assuming
// TODO: Make improvements to this interpolation, it's main issue is assuming
// that updates come at regular intervals.
fn update(&mut self, to_update: &mut WeatherGrid) {
prof_span!("WeatherLerp::update");

View File

@ -214,7 +214,7 @@ pub fn find_root() -> Option<PathBuf> {
if path.join(".git").exists() {
return Some(path);
}
// Search .git directory in parent directries
// Search .git directory in parent directories
for ancestor in path.ancestors().take(10) {
if ancestor.join(".git").exists() {
return Some(ancestor.to_path_buf());
@ -505,7 +505,7 @@ pub mod asset_tweak {
}
}
/// Convinient macro to quickly tweak value.
/// Convenient macro to quickly tweak value.
///
/// Will use [Specifier]`::Tweak` specifier and call
/// [tweak_expect] if passed only name
@ -556,7 +556,7 @@ pub mod asset_tweak {
}};
}
/// Convinient macro to quickly tweak value from some existing path.
/// Convenient macro to quickly tweak value from some existing path.
///
/// Will use [Specifier]`::Asset` specifier and call
/// [tweak_expect] if passed only name

View File

@ -23,7 +23,7 @@ const RUST_LOG_ENV: &str = "RUST_LOG";
/// following in your environment.
/// `RUST_LOG="veloren_voxygen=trace"`
///
/// more complex tracing can be done by concatenating with a `,` as seperator:
/// more complex tracing can be done by concatenating with a `,` as separator:
/// - warn for `prometheus_hyper`, `dot_vox`, `gfx_device_gl::factory,
/// `gfx_device_gl::shade` trace for `veloren_voxygen`, info for everything
/// else

View File

@ -31,7 +31,7 @@ pub enum ClientMsg {
pub enum ClientType {
/// Regular Client like Voxygen who plays the game
Game,
/// A Chatonly client, which doesn't want to connect via its character
/// A Chat-only client, which doesn't want to connect via its character
ChatOnly,
/// A unprivileged bot, e.g. to request world information
/// Or a privileged bot, e.g. to run admin commands used by server-cli

View File

@ -76,7 +76,7 @@ pub trait PackingFormula: Copy {
/// A wide, short image. Shares the advantage of not wasting space with
/// TallPacking (which is strictly worse, and was moved to benchmark code in
/// `world`), but faster to compress and smaller since PNG compresses each
/// row indepedently, so a wide image has fewer calls to the compressor. FLIP_X
/// row independently, so a wide image has fewer calls to the compressor. FLIP_X
/// has the same spatial locality preserving behavior as with TallPacking.
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub struct WidePacking<const FLIP_X: bool>();

View File

@ -7,7 +7,7 @@ use std::{
// If you want to migrate assets.
// 1) Copy-paste old asset type to own module
// 2) Copy-pase new asset type to own module
// 2) Copy-paste new asset type to own module
// (don't forget to add serde derive-s, import if needed)
// 3) impl From<old asset> for new asset.
// 4) Reference old and new assets in old and new modules

View File

@ -135,7 +135,7 @@ lazy_static! {
pub static ref BUFF_PARSER: HashMap<String, BuffKind> = {
let string_from_buff = |kind| match kind {
BuffKind::Burning => "burning",
BuffKind::Regeneration => "regeration",
BuffKind::Regeneration => "regeneration",
BuffKind::Saturation => "saturation",
BuffKind::Bleeding => "bleeding",
BuffKind::Cursed => "cursed",

View File

@ -352,7 +352,7 @@ impl Attack {
}
},
CombatEffect::Lifesteal(l) => {
// Not modified by strength_modifer as damage already is
// Not modified by strength_modifier as damage already is
if let Some(attacker_entity) = attacker.map(|a| a.entity) {
let change = HealthChange {
amount: applied_damage * l,
@ -499,7 +499,7 @@ impl Attack {
}
},
CombatEffect::Lifesteal(l) => {
// Not modified by strength_modifer as damage already is
// Not modified by strength_modifier as damage already is
if let Some(attacker_entity) = attacker.map(|a| a.entity) {
let change = HealthChange {
amount: accumulated_damage * l,
@ -1162,7 +1162,7 @@ pub fn compute_crit_mult(inventory: Option<&Inventory>, msm: &MaterialStatManife
})
}
/// Computes the energy reward modifer from worn armor
/// Computes the energy reward modifier from worn armor
#[cfg(not(target_arch = "wasm32"))]
pub fn compute_energy_reward_mod(inventory: Option<&Inventory>, msm: &MaterialStatManifest) -> f32 {
// Starts with a value of 1.0 when summing the stats from each armor piece, and

View File

@ -217,7 +217,7 @@ impl<'a> From<&'a Body> for Psyche {
quadruped_small::Species::Goat => 0.5,
quadruped_small::Species::Porcupine => 0.7,
quadruped_small::Species::Turtle => 0.7,
// FIXME: This is to balance for enemy rats in dunegeons
// FIXME: This is to balance for enemy rats in dungeons
// Normal rats should probably always flee.
quadruped_small::Species::Rat => 0.0,
quadruped_small::Species::Beaver => 0.7,
@ -546,7 +546,7 @@ impl Agent {
self
}
/// Makes agent aggresive without warning
/// Makes agent aggressive without warning
#[must_use]
pub fn with_aggro_no_warn(mut self) -> Self {
self.psyche.aggro_dist = None;

View File

@ -289,7 +289,7 @@ impl Body {
Body::FishSmall(_) => 1.0,
Body::Golem(_) => 10_000.0,
Body::Humanoid(humanoid) => {
// Understand that chaning the mass values can have effects
// Understand that changing the mass values can have effects
// on multiple systems.
//
// If you want to change that value, consult with
@ -568,8 +568,8 @@ impl Body {
}
}
// How far away other entities should try to be. Will be added uppon the other
// entitys spacing_radius. So an entity with 2.0 and an entity with 3.0 will
// How far away other entities should try to be. Will be added upon the other
// entity's spacing_radius. So an entity with 2.0 and an entity with 3.0 will
// lead to that both entities will try to keep 5.0 units away from each
// other.
pub fn spacing_radius(&self) -> f32 {

View File

@ -131,7 +131,7 @@ pub enum UtteranceKind {
Greeting,
Scream,
/* Death,
* TODO: Wait for more post-death features (i.e. animiations) before implementing death
* TODO: Wait for more post-death features (i.e. animations) before implementing death
* sounds */
}

View File

@ -138,7 +138,7 @@ impl Body {
) -> Vec3<f32> {
let v_sq = rel_flow.0.magnitude_squared();
if v_sq < 0.25 {
// don't bother with miniscule forces
// don't bother with minuscule forces
Vec3::zero()
} else {
let rel_flow_dir = Dir::new(rel_flow.0 / v_sq.sqrt());

View File

@ -87,7 +87,7 @@ impl ItemSpec {
.map(drop)
.map_err(ValidationError::ItemAssetError),
ItemSpec::Choice(choices) => {
// TODO: check for sanity of weigts?
// TODO: check for sanity of weights?
for (_weight, choice) in choices {
if let Some(item) = choice {
item.validate()?;
@ -212,7 +212,7 @@ impl Base {
/// If you want programing API of loadout creation,
/// use `LoadoutBuilder` instead.
///
/// For examples of assets, see `assets/test/ladout/ok` folder.
/// For examples of assets, see `assets/test/loadout/ok` folder.
#[derive(Debug, Deserialize, Clone, Default)]
#[serde(deny_unknown_fields)]
pub struct LoadoutSpec {
@ -1161,8 +1161,8 @@ mod tests {
// Testing different species
//
// Things that will be catched - invalid assets paths for
// creating default main hand tool or equipement without config
// Things that will be caught - invalid assets paths for
// creating default main hand tool or equipment without config
#[test]
fn test_loadout_species() {
macro_rules! test_species {

View File

@ -61,7 +61,7 @@ pub enum Meta {
// that this field should be either Default or Unchanged
// depending on how it is used.
//
// When we will use exension manifests more, it would be nicer to
// When we will use extension manifests more, it would be nicer to
// split EntityBase and EntityExtension to different structs.
//
// Fields which have Uninit enum kind
@ -69,7 +69,7 @@ pub enum Meta {
// and required (or renamed to Default) in EntityBase
/// Struct for EntityInfo manifest.
///
/// Intended to use with .ron files as base definion or
/// Intended to use with .ron files as base definition or
/// in rare cases as extension manifest.
/// Pure data struct, doesn't do anything until evaluated with EntityInfo.
///

View File

@ -33,7 +33,7 @@ pub struct StaticData {
pub recover_duration: Duration,
/// How many creatures the state should summon
pub summon_amount: u32,
/// Range of the summons relative to the summonner
/// Range of the summons relative to the summoner
pub summon_distance: (f32, f32),
/// Information about the summoned creature
pub summon_info: SummonInfo,
@ -161,7 +161,7 @@ impl CharacterBehavior for Data {
.cast()
.0;
// If a duration is specified, create a projectile componenent for the npc
// If a duration is specified, create a projectile component for the npc
let projectile = self.static_data.duration.map(|duration| Projectile {
hit_solid: Vec::new(),
hit_entity: Vec::new(),

View File

@ -173,7 +173,7 @@ impl CharacterBehavior for Data {
.get(self.stage as usize - 1)
.map_or(0, |_| self.stage as usize - 1);
let speed_modifer = 1.0
let speed_modifier = 1.0
+ self.static_data.max_speed_increase
* (1.0 - self.static_data.speed_increase.powi(combo_counter as i32));
@ -190,7 +190,7 @@ impl CharacterBehavior for Data {
// Build up
update.character = CharacterState::ComboMelee(Data {
static_data: self.static_data.clone(),
timer: tick_attack_or_default(data, self.timer, Some(speed_modifer)),
timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)),
..*self
});
} else {
@ -315,7 +315,7 @@ impl CharacterBehavior for Data {
// Swings
update.character = CharacterState::ComboMelee(Data {
static_data: self.static_data.clone(),
timer: tick_attack_or_default(data, self.timer, Some(speed_modifer)),
timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)),
..*self
});
} else {
@ -339,7 +339,7 @@ impl CharacterBehavior for Data {
// Recovers
update.character = CharacterState::ComboMelee(Data {
static_data: self.static_data.clone(),
timer: tick_attack_or_default(data, self.timer, Some(speed_modifer)),
timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)),
..*self
});
} else {

View File

@ -22,7 +22,7 @@ pub struct StaticData {
pub buildup_duration: Duration,
/// How long the state charges for until it reaches max damage
pub charge_duration: Duration,
/// Suration of state spent in swing
/// Duration of state spent in swing
pub swing_duration: Duration,
/// How long the state has until exiting
pub recover_duration: Duration,

View File

@ -86,7 +86,7 @@ impl BlockKind {
#[inline]
pub const fn is_filled(&self) -> bool { !self.is_fluid() }
/// Determine whether the block has an RGB color storaged in the attribute
/// Determine whether the block has an RGB color stored in the attribute
/// fields.
#[inline]
pub const fn has_color(&self) -> bool { self.is_filled() }

View File

@ -116,7 +116,7 @@ impl<'a> System<'a> for Sys {
if frame_time <= 0.0 {
return (server_events, add_hit_entities, outcomes);
}
// Note: min() probably uneeded
// Note: min() probably unneeded
let time_since_creation = (time - creation_time) as f32;
let frame_start_dist =
(beam_segment.speed * (time_since_creation - frame_time)).max(0.0);

View File

@ -86,7 +86,7 @@ fn fall_simple() -> Result<(), Box<dyn Error>> {
#[test]
/// will fall in 20 x DT and 2 x 10*DT steps. compare the end result and make
/// log the "error" between both caluclation
/// log the "error" between both calculations
fn fall_dt_speed_diff() -> Result<(), Box<dyn Error>> {
let mut sstate = utils::setup();
let mut fstate = utils::setup();
@ -213,7 +213,7 @@ fn walk_max() -> Result<(), Box<dyn Error>> {
#[test]
/// will run in 20 x DT and 2 x 10*DT steps. compare the end result and make
/// log the "error" between both caluclation
/// log the "error" between both calculations
fn walk_dt_speed_diff() -> Result<(), Box<dyn Error>> {
let mut sstate = utils::setup();
let mut fstate = utils::setup();

View File

@ -461,7 +461,7 @@ mod tests {
}
#[test]
fn initframe_rubish() {
fn initframe_rubbish() {
let mut buffer = BytesMut::from(&b"dtrgwcser"[..]);
assert_eq!(
InitFrame::read_frame(&mut buffer),

View File

@ -160,7 +160,7 @@ pub struct StreamParams {
/// via their [`ConnectAddr`], or [`listen`] passively for [`connected`]
/// [`Participants`] via [`ListenAddr`].
///
/// Too guarantee a clean shutdown, the [`Runtime`] MUST NOT be droped before
/// Too guarantee a clean shutdown, the [`Runtime`] MUST NOT be dropped before
/// the Network.
///
/// # Examples
@ -516,7 +516,7 @@ impl Network {
};
if let Ok(return_s) = return_s {
if return_s.send(()).is_err() {
warn!("Network::drop stoped after a timeout and didn't wait for our shutdown");
warn!("Network::drop stopped after a timeout and didn't wait for our shutdown");
};
}
debug!("Network has shut down");
@ -550,7 +550,7 @@ impl Participant {
/// # Arguments
/// * `prio` - defines which stream is processed first when limited on
/// bandwidth. See [`Prio`] for documentation.
/// * `promises` - use a combination of you prefered [`Promises`], see the
/// * `promises` - use a combination of you preferred [`Promises`], see the
/// link for further documentation. You can combine them, e.g.
/// `Promises::ORDERED | Promises::CONSISTENCY` The Stream will then
/// guarantee that those promises are met.
@ -1177,7 +1177,7 @@ where
},
Err(TryRecvError::Closed) => panic!("{}{}", name, CHANNEL_ERR),
Err(TryRecvError::Empty) => {
trace!("activly sleeping");
trace!("actively sleeping");
cnt += 1;
if cnt > 10 {
error!("Timeout waiting for shutdown, dropping");
@ -1222,7 +1222,7 @@ impl Drop for Participant {
debug!("Shutting down Participant");
match self.a2s_disconnect_s.try_lock() {
Err(e) => debug!(?e, "Participant is beeing dropped by Network right now"),
Err(e) => debug!(?e, "Participant is being dropped by Network right now"),
Ok(mut s) => match s.take() {
None => info!("Participant already has been shutdown gracefully"),
Some(a2s_disconnect_s) => {

View File

@ -623,7 +623,7 @@ impl UnreliableDrain for QuicDrain {
match self.reliables.entry(sid) {
Entry::Occupied(mut occupied) => occupied.get_mut().write_all(&data.data).await,
Entry::Vacant(vacant) => {
// IF the buffer is empty this was created localy and WE are allowed to
// IF the buffer is empty this was created locally and WE are allowed to
// open_bi(), if not, we NEED to block on sendstreams_r
if data.data.is_empty() {
let (mut sendstream, recvstream) =

View File

@ -8,7 +8,7 @@ We include instructions for Nix without flakes enabled, but using flakes is the
See the [NixOS wiki](https://nixos.wiki/wiki/Flakes) for information on how to enable and use flakes.
It is recommended to first setup the [Cachix](https://cachix.org) cache to save time with builds:
It is recommended to first set up the [Cachix](https://cachix.org) cache to save time with builds:
```shell
nix shell nixpkgs#cachix -c cachix use veloren-nix
# or if you don't have flakes:
@ -16,7 +16,7 @@ nix-shell -p cachix --run "cachix use veloren-nix"
```
As this repository uses `git-lfs`, please make sure `git-lfs` is in your path.
If you have a locally cloned repo, you can make sure it is setup with:
If you have a locally cloned repo, you can make sure it is set up with:
```shell
git lfs install --local && git lfs fetch && git lfs checkout
```

View File

@ -121,7 +121,7 @@ pub mod event {
/// #[event_handler]
/// pub fn on_command_testplugin(command: ChatCommandEvent) -> Result<Vec<String>, String> {
/// Ok(vec![format!(
/// "Player of id {:?} named {} with {:?} sended command with args {:?}",
/// "Player of id {:?} named {} with {:?} sent command with args {:?}",
/// command.player.id,
/// command
/// .player

View File

@ -100,7 +100,7 @@ static mut BUFFERS: Vec<u8> = Vec::new();
/// Allocate buffer from wasm linear memory
/// # Safety
/// This function should never be used only intented to by used by the host
/// This function should never be used only intended to by used by the host
#[no_mangle]
pub unsafe fn wasm_prepare_buffer(size: i32) -> i64 {
BUFFERS = vec![0u8; size as usize];

View File

@ -101,7 +101,7 @@ impl Client {
| ServerGeneral::CharacterSuccess => {
self.character_screen_stream.lock().unwrap().send(g)
},
//Ingame related
//In-game related
ServerGeneral::GroupUpdate(_)
| ServerGeneral::Invite { .. }
| ServerGeneral::InvitePending(_)
@ -175,7 +175,7 @@ impl Client {
| ServerGeneral::CharacterSuccess => {
PreparedMsg::new(1, &g, &self.character_screen_stream_params)
},
//Ingame related
//In-game related
ServerGeneral::GroupUpdate(_)
| ServerGeneral::Invite { .. }
| ServerGeneral::InvitePending(_)
@ -192,7 +192,7 @@ impl Client {
| ServerGeneral::WeatherUpdate(_) => {
PreparedMsg::new(2, &g, &self.in_game_stream_params)
},
//Ingame related, terrain
//In-game related, terrain
ServerGeneral::TerrainChunkUpdate { .. }
| ServerGeneral::LodZoneUpdate { .. }
| ServerGeneral::TerrainBlockUpdates(_) => {

View File

@ -972,12 +972,12 @@ fn handle_time(
// 'developer commentary' mode created by digging up the long-decayed
// skeletons of the Veloren team, measuring various attributes of their
// jawlines, and using them to recreate their voices. But how to go about
// this Herculean task? This code is jibberish! The last of the core Rust
// this Herculean task? This code is gibberish! The last of the core Rust
// dev team died exactly 337,194 years ago! Rust is now a long-forgotten
// dialect of the ancient ones, lost to the sands of time. Ashes to ashes,
// dust to dust. When all hope is lost, one particularly intrepid
// post-human hominid exployed by the 'Veloren Revival Corp' (no doubt we
// still won't have gotted rid of this blasted 'capitalism' thing by then)
// still won't have gotten rid of this blasted 'capitalism' thing by then)
// might notice, after years of searching, a particularly curious
// inscription within the code. The letters `D`, `A`, `Y`. Curious! She
// consults the post-human hominid scholars of the old. Care to empathise
@ -986,7 +986,7 @@ fn handle_time(
// 'day' in the post-human hominid language, which is of course universal.
// Imagine also her surprise when, after much further translating, she
// finds a comment predicting her very existence and her struggle to
// decode this great mystery. Rejoyce! The Veloren Revival Corp. may now
// decode this great mystery. Rejoice! The Veloren Revival Corp. may now
// persist with their great Ultimate Edition DLC because the day period
// might now be changed because they have found the constant that controls
// it! Everybody was henceforth happy until the end of time.
@ -2778,7 +2778,7 @@ spawn_rate {:?} "#,
server.notify_client(client, ServerGeneral::server_msg(ChatType::CommandInfo, s));
Ok(())
} else {
Err("Not a pregenerated chunk.".into())
Err("Not a pre-generated chunk.".into())
}
}
@ -3131,7 +3131,7 @@ fn handle_ban(
.map(|duration| chrono::Duration::from_std(duration.into()))
.transpose()
.map_err(|err| format!("Error converting to duration: {}", err))?
// On overflow (someone adding some ridiculous timespan), just make the ban infinite.
// On overflow (someone adding some ridiculous time span), just make the ban infinite.
.and_then(|duration| now.checked_add_signed(duration));
let ban_info = BanInfo {

View File

@ -68,7 +68,8 @@ impl ConnectionHandler {
Some(Err(e)) => {
error!(
?e,
"Stopping Conection Handler, no new connections can be made to server now!"
"Stopping Connection Handler, no new connections can be made to server \
now!"
);
break;
},

View File

@ -131,7 +131,7 @@ pub fn handle_create_npc(
.map(|g| (g, c))
})
.map(|(g, c)| {
// Might be unneccessary, but maybe pets can somehow have map
// Might be unnecessary, but maybe pets can somehow have map
// markers in the future
update_map_markers(&map_markers, &uids, c, &group_change);
c.send_fallible(ServerGeneral::GroupUpdate(g));

View File

@ -222,7 +222,7 @@ pub fn handle_group(server: &mut Server, entity: Entity, manip: GroupManip) {
"You were removed from the group.",
));
}
// Tell kicker that they were succesful
// Tell kicker that they were successful
if let Some(client) = clients.get(entity) {
client.send_fallible(ServerGeneral::server_msg(
ChatType::Meta,

View File

@ -504,7 +504,7 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv
if let Some(pos) = ecs.read_storage::<comp::Pos>().get(entity) {
let mut merged_stacks = false;
// If both slots have items and we're attemping to drag from one stack
// If both slots have items and we're attempting to drag from one stack
// into another, stack the items.
if let (Slot::Inventory(slot_a), Slot::Inventory(slot_b)) = (a, b) {
merged_stacks |= inventory.merge_stack_into(slot_a, slot_b);
@ -538,7 +538,7 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv
let ability_map = state.ecs().read_resource::<AbilityMap>();
let msm = state.ecs().read_resource::<MaterialStatManifest>();
// If both slots have items and we're attemping to split from one stack
// If both slots have items and we're attempting to split from one stack
// into another, ensure that they are the same type of item. If they are
// the same type do nothing, as you don't want to overwrite the existing item.

View File

@ -113,7 +113,7 @@ pub fn handle_invite(server: &mut Server, inviter: Entity, invitee_uid: Uid, kin
}
let mut invite_sent = false;
// Returns true if insertion was succesful
// Returns true if insertion was successful
let mut send_invite = || {
match invites.insert(invitee, Invite { inviter, kind }) {
Err(err) => {

View File

@ -1385,7 +1385,7 @@ impl Server {
let world_dims_chunks = self.world.sim().get_size();
let world_dims_blocks = TerrainChunkSize::blocks(world_dims_chunks);
// NOTE: origin is in the corner of the map
// TODO: extend this function to have picking a random position or specifiying a
// TODO: extend this function to have picking a random position or specifying a
// position as options
//let mut rng = rand::thread_rng();
// // Pick a random position but not to close to the edge

View File

@ -199,7 +199,7 @@ fn tool_kind_to_string(tool: Option<comp::item::tool::ToolKind>) -> String {
Some(Blowgun) => "Blowgun",
Some(Pick) => "Pick",
// Toolkinds that are not anticipated to have many active aiblities (if any at all)
// Toolkinds that are not anticipated to have many active abilities (if any at all)
Some(Farming) => "Farming",
Some(Debug) => "Debug",
Some(Natural) => "Natural",

View File

@ -47,7 +47,7 @@ const BIRD_MEDIUM_ROSTER: &[comp::bird_medium::Species] = &[
];
const BIRD_LARGE_ROSTER: &[comp::bird_large::Species] = &[
// Flame Wyvern not incuded until proper introduction
// Flame Wyvern not included until proper introduction
comp::bird_large::Species::Phoenix,
comp::bird_large::Species::Cockatrice,
comp::bird_large::Species::Roc,

View File

@ -477,7 +477,7 @@ mod v1 {
impl Banlist {
/// Attempt to perform the ban action `action` for the user with UUID
/// `uuid` and username `username`, starting from itme `now`
/// `uuid` and username `username`, starting from time `now`
/// (the information about the banning party will
/// be in the `action` record), with a settings file maintained at path
/// root `data_dir`.

View File

@ -83,8 +83,8 @@ pub trait EditableSetting: Clone + Default {
file.seek(SeekFrom::Start(0))?;
ron::de::from_reader(file)
.map(|legacy| Ok((Version::Old, Self::Legacy::into(legacy))))
// When both legacy and nonlegacy have parse errors, prioritize the
// nonlegacy one, since we can't tell which one is "right" and legacy
// When both legacy and non-legacy have parse errors, prioritize the
// non-legacy one, since we can't tell which one is "right" and legacy
// formats are simple, early, and uncommon enough that we expect
// few parse errors in those.
.or(Err(orig_err))

View File

@ -157,7 +157,7 @@ impl<'a> System<'a> for Sys {
// Default to looking in orientation direction
// (can be overridden below)
//
// This definetly breaks LeapMelee and
// This definitely breaks LeapMelee and
// probably not only that, do we really need this at all?
controller.reset();
controller.inputs.look_dir = ori.look_dir();
@ -1359,7 +1359,7 @@ impl<'a> AgentData<'a> {
let balance1: f32 = prices.balance(&pending.offers, &inventories, who, false);
if balance0 >= balance1 {
// If the trade is favourable to us, only send an accept message if we're
// not already accepting (since otherwise, spamclicking the accept button
// not already accepting (since otherwise, spam-clicking the accept button
// results in lagging and moving to the review phase of an unfavorable trade
// (although since the phase is included in the message, this shouldn't
// result in fully accepting an unfavourable trade))
@ -1614,8 +1614,8 @@ impl<'a> AgentData<'a> {
};
let is_valid_target = |entity: EcsEntity| match read_data.bodies.get(entity) {
Some(Body::ItemDrop(item)) => {
//If the agent is humanoid, it will pick up all kinds of itemdrops. If the
// agent isn't humanoid, it will pick up only consumable itemdrops.
//If the agent is humanoid, it will pick up all kinds of item drops. If the
// agent isn't humanoid, it will pick up only consumable item drops.
let wants_pickup = matches!(self.body, Some(Body::Humanoid(_)))
|| matches!(item, item_drop::Body::Consumable);
@ -2174,7 +2174,7 @@ impl<'a> AgentData<'a> {
let sound_pos = Pos(sound.pos);
let dist_sqrd = self.pos.0.distance_squared(sound_pos.0);
// NOTE: There is an implicit distance requirement given that sound volume
// disipates as it travels, but we will not want to flee if a sound is super
// dissipates as it travels, but we will not want to flee if a sound is super
// loud but heard from a great distance, regardless of how loud it was.
// `is_close` is this limiter.
let is_close = dist_sqrd < 35.0_f32.powi(2);

View File

@ -1411,7 +1411,7 @@ impl<'a> AgentData<'a> {
const MINION_SUMMON_THRESHOLD: f32 = 0.20;
let health_fraction = self.health.map_or(0.5, |h| h.fraction());
// Sets counter at start of combat, using `condition` to keep track of whether
// it was already intitialized
// it was already initialized
if !agent.action_state.condition {
agent.action_state.counter = 1.0 - MINION_SUMMON_THRESHOLD;
agent.action_state.condition = true;
@ -1742,7 +1742,7 @@ impl<'a> AgentData<'a> {
&& attack_data.angle < 90.0
&& attack_data.in_min_range()
{
// Triplestrike
// Triple strike
controller.push_basic_input(InputKind::Secondary);
agent.action_state.timer += read_data.dt.0;
} else {
@ -2152,7 +2152,7 @@ impl<'a> AgentData<'a> {
};
// Sets counter at start of combat, using `condition` to keep track of whether
// it was already intitialized
// it was already initialized
if !agent.action_state.condition {
agent.action_state.counter = 1.0 - MINION_SUMMON_THRESHOLD;
agent.action_state.condition = true;

View File

@ -71,7 +71,7 @@ impl AttackData {
#[derive(Eq, PartialEq)]
// When adding a new variant, first decide if it should instead fall under one
// of the pre-exisitng tactics
// of the pre-existing tactics
pub enum Tactic {
// General tactics
SimpleMelee,

View File

@ -46,11 +46,11 @@ impl Animation for IdleAnimation {
let breathe = if s_a.beast {
// Controls for the beast breathing
let intensity = 0.04;
let lenght = 1.5;
let length = 1.5;
let chop = 0.2;
let chop_freq = 60.0;
intensity * (lenght * anim_time).sin()
+ 0.05 * chop * (anim_time * chop_freq).sin() * (anim_time * lenght).cos()
intensity * (length * anim_time).sin()
+ 0.05 * chop * (anim_time * chop_freq).sin() * (anim_time * length).cos()
} else {
0.0
};

View File

@ -59,7 +59,7 @@ impl Animation for DashAnimation {
let speedmult = 0.8;
let lab: f32 = 0.6; //6
// acc_vel and anim_time mix to make sure phase lenght isn't starting at
// acc_vel and anim_time mix to make sure phase length isn't starting at
// +infinite
let mixed_vel = acc_vel + anim_time * 5.0; //sets run frequency using speed, with anim_time setting a floor

View File

@ -53,12 +53,12 @@ fn compare_lang_with_reference(
i18n_references: &RawLanguage<LocalizationEntryState>,
repo: &git2::Repository,
) {
// git graph decendent of is slow, so we cache it
let mut graph_decendent_of_cache = HashMap::new();
// git graph descendant of is slow, so we cache it
let mut graph_descendant_of_cache = HashMap::new();
let mut cached_graph_descendant_of = |commit, ancestor| -> bool {
let key = (commit, ancestor);
match graph_decendent_of_cache.entry(key) {
match graph_descendant_of_cache.entry(key) {
Entry::Occupied(entry) => {
return *entry.get();
},

View File

@ -35,7 +35,7 @@ pub struct Art {
#[serde(default)]
pub modifications: String,
/// Any additional attribution notes that may be desired and/or required by
/// the respactive license that can't be conveyed or would be awkward to
/// the respective license that can't be conveyed or would be awkward to
/// convey with the other provided fields.
#[serde(default)]
pub notes: String,
@ -45,7 +45,7 @@ pub struct Art {
pub struct Contributor {
pub name: String,
/// Short note or description of the contributions
/// Optional, can be left empty/ommitted
/// Optional, can be left empty/omitted
#[serde(default)]
pub contributions: String,
}

View File

@ -100,7 +100,7 @@ pub struct State {
ids: Ids,
}
#[allow(clippy::enum_variant_names)] //think about renaming to ToogleEvent
#[allow(clippy::enum_variant_names)] //think about renaming to ToggleEvent
pub enum Event {
ToggleBag,
ToggleSettings,

View File

@ -883,7 +883,7 @@ mod tests {
Ok(("say".to_string(), vec!["Hello World".to_string()]));
assert_eq!(parse_cmd(r#"say "Hello World""#), expected);
// Note: \n in the exptected gets expanded by rust to a newline character, thats
// Note: \n in the expected gets expanded by rust to a newline character, that's
// why we must not use a raw string in the expected
let expected: Result<(String, Vec<String>), String> =
Ok(("say".to_string(), vec!["Hello\nWorld".to_string()]));

View File

@ -274,14 +274,14 @@ pub struct State {
enum SearchFilter {
None,
Input,
Nonexistant,
Nonexistent,
}
impl SearchFilter {
fn parse_from_str(string: &str) -> Self {
match string {
"input" => Self::Input,
_ => Self::Nonexistant,
_ => Self::Nonexistent,
}
}
}
@ -581,7 +581,7 @@ impl<'a> Widget for Crafting<'a> {
},
}
}),
SearchFilter::Nonexistant => false,
SearchFilter::Nonexistent => false,
})
.map(|(name, recipe)| {
let has_materials = self.client.available_recipes().get(name.as_str()).is_some();
@ -612,7 +612,7 @@ impl<'a> Widget for Crafting<'a> {
// TODO: Get input filtering to work here, probably requires
// checking component recipe book?
SearchFilter::Input => false,
SearchFilter::Nonexistant => false,
SearchFilter::Nonexistent => false,
}
})
.map(|(recipe_name, (recipe, _))| {

View File

@ -384,7 +384,7 @@ impl<'a> Widget for Map<'a> {
}
}
// Handle zooming with the mousewheel
// Handle zooming with the mouse wheel
let scrolled: f64 = ui
.widget_input(widget)
.scrolls()

View File

@ -1125,7 +1125,7 @@ impl<'a> Widget for Interface<'a> {
.color(TEXT_COLOR)
.set(state.ids.experience_numbers_title, ui);
// Acuumulate Experience Gained
// Accumulate Experience Gained
let accum_experience = ToggleButton::new(
self.global_state.settings.interface.accum_experience,
self.imgs.checkbox,

View File

@ -12,7 +12,7 @@ impl<T: Copy + Pod> Consts<T> {
/// Create a new `Const<T>`.
pub fn new(device: &wgpu::Device, len: usize) -> Self {
Self {
// TODO: examine if all our consts need to be updateable
// TODO: examine if all our consts need to be updatable
buf: DynamicBuffer::new(device, len, wgpu::BufferUsage::UNIFORM),
}
}

View File

@ -214,7 +214,7 @@ impl BloomPipelines {
dst_factor: wgpu::BlendFactor::One,
operation: wgpu::BlendOperation::Add,
},
// We don't reaaly use this but we need something here..
// We don't really use this but we need something here..
alpha: wgpu::BlendComponent::REPLACE,
}),
);

View File

@ -31,7 +31,7 @@ impl VertexTrait for Vertex {
#[repr(C)]
#[derive(Copy, Clone, Debug, Zeroable, Pod)]
pub struct Locals {
/// pos is [f32; 4] instead of [f32; 3] so that Locals's size is a multiple
/// pos is [f32; 4] instead of [f32; 3] so that Locals' size is a multiple
/// of 8 bytes (which is required by gfx), the last component is ignored
/// by the shader
pub pos: [f32; 4],

View File

@ -23,7 +23,7 @@ use {common_base::span, egui_wgpu_backend::ScreenDescriptor, egui_winit_platform
enum Pipelines<'frame> {
Interface(&'frame super::InterfacePipelines),
All(&'frame super::Pipelines),
// Should never be in this state for now but we need this to accound for super::State::Nothing
// Should never be in this state for now but we need this to account for super::State::Nothing
None,
}
@ -53,7 +53,7 @@ impl<'frame> Pipelines<'frame> {
}
// Borrow the fields we need from the renderer so that the GpuProfiler can be
// disjointly borrowed mutably
// disjointedly borrowed mutably
struct RendererBorrow<'frame> {
queue: &'frame wgpu::Queue,
device: &'frame wgpu::Device,
@ -371,7 +371,7 @@ impl<'frame> Drawer<'frame> {
label,
&bloom_pipelines.upsample,
if index + 2 == bloom::NUM_SIZES {
// Clear for the final image since that is just stuff from the pervious frame.
// Clear for the final image since that is just stuff from the previous frame.
wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT)
} else {
// Add to less blurred images to get gradient of blur instead of a smudge>

View File

@ -242,11 +242,11 @@ fn clamp_and_modulate(ori: Vec3<f32>) -> Vec3<f32> {
/// though the logic for why it should be okay to pass them directly is probably
/// sound (they are both valid z values in the range, so gl_FragCoord.w will be
/// assigned to this, meaning if they are imprecise enough then the whole
/// calculation will be similarly imprecies).
/// calculation will be similarly imprecise).
///
/// TODO: Since it's a bit confusing that n and f are not always near and far,
/// and a negative near plane can (probably) be emulated with simple actions on
/// the perspective matrix, consider removing this functionailty and replacing
/// the perspective matrix, consider removing this functionality and replacing
/// our assertion with a single condition: `(1/far) * (1/near) < (1/near)²`.
pub fn perspective_lh_zo_general<T>(
fov_y_radians: T,
@ -381,8 +381,8 @@ impl Camera {
Vec3::new(0.0, 0.0, -1.0),
Vec3::new(0.0, 0.0, 1.0),
];
// Calculate new frustom location as there may have been lerp towards tgt_dist
// Without this, there will be camera jumpig back and forth in some scenarios
// Calculate new frustum location as there may have been lerp towards tgt_dist
// Without this, there will be camera jumping back and forth in some scenarios
// TODO: Optimize and fix clipping still happening if self.dist << self.tgt_dist
// Use tgt_dist, as otherwise we end up in loop due to dist depending on frustum
@ -703,7 +703,7 @@ impl Camera {
/// Get the mode of the camera
pub fn get_mode(&self) -> CameraMode {
// Perfom a bit of a trick... don't report first-person until the camera has
// Perform a bit of a trick... don't report first-person until the camera has
// lerped close enough to the player.
match self.mode {
CameraMode::FirstPerson if self.dist < 0.5 => CameraMode::FirstPerson,

View File

@ -111,8 +111,8 @@ impl DebugShape {
// stretch to radius
let a = a * *radius;
// rotate to 90 degrees to get needed shift
let ortoghonal = Quaternion::rotation_z(PI / 2.0);
let shift = ortoghonal * a;
let orthogonal = Quaternion::rotation_z(PI / 2.0);
let shift = orthogonal * a;
// bottom points
let a0 = p0 + shift;

View File

@ -152,7 +152,7 @@ impl Lod {
self.zone_objects
.retain(|p, _| client.lod_zones().contains_key(p));
// Determine visiblity of zones based on view frustum
// Determine visibility of zones based on view frustum
let camera::Dependents {
view_mat,
proj_mat_treeculler,

View File

@ -98,7 +98,7 @@ impl ExportVol {
// File format defined at https://github.com/ephtracy/voxel-model
fn write_i32(file: &mut File, value: i32) -> Result {
// The spec doesn't specify endianess?!?
// The spec doesn't specify endianness?!?
file.write_all(&value.to_le_bytes())
}

View File

@ -198,7 +198,7 @@ impl<'a> Canvas<'a> {
/// Blit a structure on to the canvas at the given position.
///
/// Note that this function should be called with identitical parameters by
/// Note that this function should be called with identical parameters by
/// all chunks within the bounds of the structure to avoid cut-offs
/// occurring at chunk borders. Deterministic RNG is advised!
pub fn blit_structure(

View File

@ -1119,7 +1119,7 @@ fn erode(
},
);
debug!(
"(Done precomputation, time={:?}ms).",
"(Done pre-computation, time={:?}ms).",
start_time.elapsed().as_millis()
);
#[rustfmt::skip]

View File

@ -1331,7 +1331,7 @@ impl Floor {
sprites.push((floor_sprite, floor_sprite_fill.clone()));
}
// Place a glowing purple septagonal star inscribed in a circle in the boss room
// Place a glowing purple heptagonal star inscribed in a circle in the boss room
if let Some(boss_room_center) = boss_room_center {
let magic_circle_bb = painter.prim(Primitive::Cylinder(Aabb {
min: (boss_room_center - 3 * Vec2::broadcast(TILE_SIZE) / 2).with_z(floor_z - 1),
@ -1346,7 +1346,7 @@ impl Floor {
// Place pillars and pillar lights facing the pillars
for (pos, pillar, lights) in pillars.iter() {
// Avoid placing pillars that would cover the septagonal star
// Avoid placing pillars that would cover the heptagonal star
if let Some(boss_room_center) = boss_room_center {
if pos.distance_squared(boss_room_center) < (3 * TILE_SIZE / 2).pow(2) {
continue;