Fixed network replicated-object deduplication by hashing/equality on ObjectId
Aligned NetworkReplicatedObject equality with its hash (compare ObjectId, not pointer).
This commit is contained in:
@@ -152,12 +152,12 @@ struct NetworkReplicatedObject
|
||||
|
||||
bool operator==(const NetworkReplicatedObject& other) const
|
||||
{
|
||||
return Object == other.Object;
|
||||
return ObjectId == other.ObjectId;
|
||||
}
|
||||
|
||||
bool operator==(const ScriptingObject* other) const
|
||||
{
|
||||
return Object == other;
|
||||
return other && ObjectId == other->GetID();
|
||||
}
|
||||
|
||||
bool operator==(const Guid& other) const
|
||||
@@ -176,6 +176,11 @@ inline uint32 GetHash(const NetworkReplicatedObject& key)
|
||||
return GetHash(key.ObjectId);
|
||||
}
|
||||
|
||||
inline uint32 GetHash(const ScriptingObject* key)
|
||||
{
|
||||
return key ? GetHash(key->GetID()) : 0;
|
||||
}
|
||||
|
||||
struct Serializer
|
||||
{
|
||||
NetworkReplicator::SerializeFunc Methods[2];
|
||||
|
||||
Reference in New Issue
Block a user