mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
* rename CharacterState equals() -> same_variant()
This commit is contained in:
parent
afa6e43dd5
commit
db8d89a4d9
@ -393,7 +393,7 @@ impl Client {
|
||||
{
|
||||
if last_character_states
|
||||
.get(entity)
|
||||
.map(|l| !client_character_state.equals(&l.0))
|
||||
.map(|l| !client_character_state.same_variant(&l.0))
|
||||
.unwrap_or(true)
|
||||
{
|
||||
let _ = last_character_states
|
||||
|
@ -111,7 +111,7 @@ impl CharacterState {
|
||||
}
|
||||
|
||||
/// Compares for shallow equality (does not check internal struct equality)
|
||||
pub fn equals(&self, other: &Self) -> bool {
|
||||
pub fn same_variant(&self, other: &Self) -> bool {
|
||||
// Check if state is the same without looking at the inner data
|
||||
std::mem::discriminant(self) == std::mem::discriminant(other)
|
||||
}
|
||||
|
@ -418,7 +418,7 @@ impl FigureMgr {
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
if !character.equals(&last_character.0) {
|
||||
if !character.same_variant(&last_character.0) {
|
||||
state.state_time = 0.0;
|
||||
}
|
||||
|
||||
@ -650,7 +650,7 @@ impl FigureMgr {
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
if !character.equals(&last_character.0) {
|
||||
if !character.same_variant(&last_character.0) {
|
||||
state.state_time = 0.0;
|
||||
}
|
||||
|
||||
@ -730,7 +730,7 @@ impl FigureMgr {
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
if !character.equals(&last_character.0) {
|
||||
if !character.same_variant(&last_character.0) {
|
||||
state.state_time = 0.0;
|
||||
}
|
||||
|
||||
@ -810,7 +810,7 @@ impl FigureMgr {
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
if !character.equals(&last_character.0) {
|
||||
if !character.same_variant(&last_character.0) {
|
||||
state.state_time = 0.0;
|
||||
}
|
||||
|
||||
@ -884,7 +884,7 @@ impl FigureMgr {
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
if !character.equals(&last_character.0) {
|
||||
if !character.same_variant(&last_character.0) {
|
||||
state.state_time = 0.0;
|
||||
}
|
||||
|
||||
@ -958,7 +958,7 @@ impl FigureMgr {
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
if !character.equals(&last_character.0) {
|
||||
if !character.same_variant(&last_character.0) {
|
||||
state.state_time = 0.0;
|
||||
}
|
||||
|
||||
@ -1032,7 +1032,7 @@ impl FigureMgr {
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
if !character.equals(&last_character.0) {
|
||||
if !character.same_variant(&last_character.0) {
|
||||
state.state_time = 0.0;
|
||||
}
|
||||
|
||||
@ -1106,7 +1106,7 @@ impl FigureMgr {
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
if !character.equals(&last_character.0) {
|
||||
if !character.same_variant(&last_character.0) {
|
||||
state.state_time = 0.0;
|
||||
}
|
||||
|
||||
@ -1180,7 +1180,7 @@ impl FigureMgr {
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
if !character.equals(&last_character.0) {
|
||||
if !character.same_variant(&last_character.0) {
|
||||
state.state_time = 0.0;
|
||||
}
|
||||
|
||||
@ -1254,7 +1254,7 @@ impl FigureMgr {
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
if !character.equals(&last_character.0) {
|
||||
if !character.same_variant(&last_character.0) {
|
||||
state.state_time = 0.0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user