Move std::mem::discriminant into new method

This commit is contained in:
timokoesters
2019-08-30 20:40:22 +02:00
committed by jshipsey
parent d822356161
commit 9a832dd56b
4 changed files with 20 additions and 26 deletions

View File

@ -1161,13 +1161,7 @@ impl Server {
{
if last_character_state
.get(entity)
.map(|&l| {
// Check if enum item is the same without looking at the inner data
std::mem::discriminant(&l.0.movement)
!= std::mem::discriminant(&client_character_state.movement)
|| std::mem::discriminant(&l.0.action)
!= std::mem::discriminant(&client_character_state.action)
})
.map(|&l| !client_character_state.is_same_state(&l.0))
.unwrap_or(true)
{
let _ =