Skip to content

Commit

Permalink
Add comparison operator for EntityID
Browse files Browse the repository at this point in the history
Close #103
  • Loading branch information
wopss committed Dec 17, 2023
1 parent ce1d868 commit 112ce0c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/RED4ext/Scripting/Natives/entEntityID.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <compare>

#include <RED4ext/Common.hpp>

namespace RED4ext::ent
Expand Down Expand Up @@ -38,6 +40,11 @@ struct EntityID
return hash == aRhs.hash;
}

constexpr std::strong_ordering operator<=>(const EntityID& aRhs) const noexcept
{
return hash <=> aRhs.hash;
}

[[nodiscard]] constexpr bool IsDefined() const noexcept
{
return hash;
Expand Down

0 comments on commit 112ce0c

Please sign in to comment.