Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
martonp96 committed Oct 2, 2023
2 parents d2cef90 + 32548a7 commit 2d999ad
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
23 changes: 22 additions & 1 deletion c-api/cache/CachedBaseObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace cache
{
};

CachedBaseObject(IBaseObject* base) : _type(base->GetType())
CachedBaseObject(IBaseObject* base) : _type(base->GetType()), _id(base->GetID())
{
auto keys = base->GetMetaDataKeys();
for (const auto& key : keys)
Expand Down Expand Up @@ -67,6 +67,27 @@ namespace cache
{
return false;
}

bool HasSyncedMetaData(const std::string & key) const override
{
return false;
}

alt::MValueConst GetSyncedMetaData(const std::string & key) const override
{
return alt::ICore::Instance().CreateMValueNil();
}

uint32_t _id;
uint32_t GetID() const override
{
return _id;
}

std::vector<std::string> GetSyncedMetaDataKeys() const override
{
return {};
}

void SetMultipleMetaData(const std::unordered_map<std::string, alt::MValue>& values) override {}

Expand Down
14 changes: 4 additions & 10 deletions c-api/cache/CachedEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace cache
class CachedEntity : public virtual CachedWorldObject, public virtual CachedBaseObject, public virtual alt::IEntity
{
public:
CachedEntity(IEntity* base) : CachedBaseObject(base), CachedWorldObject(base), _id(base->GetID()),
CachedEntity(IEntity* base) : CachedBaseObject(base), CachedWorldObject(base),
_networkOwner(base->GetNetworkOwner()),
_model(base->GetModel()),
_rotation(base->GetRotation()),
Expand Down Expand Up @@ -41,14 +41,7 @@ namespace cache
_streamSyncedMetaData[key] = base->GetStreamSyncedMetaData(key);
}
}

uint32_t _id;

uint32_t GetID() const override
{
return _id;
}


uint16_t GetSyncID() const override { return static_cast<uint16_t>(_id)/*only temp*/; }

alt::IPlayer* _networkOwner;
Expand Down Expand Up @@ -213,13 +206,14 @@ namespace cache
}

uint32_t _streamingDistance;

uint32_t GetStreamingDistance() const override
{
return _streamingDistance;
}

void SetMultipleStreamSyncedMetaData(const std::unordered_map<std::string, alt::MValue>& values) override {}

void SetStreamingDistance(uint32_t streamingDistance) override {}
#endif


Expand Down
2 changes: 1 addition & 1 deletion c-api/cache/CachedPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,4 +607,4 @@ namespace cache
#endif

};
} // namespace alt
} // namespace alt

0 comments on commit 2d999ad

Please sign in to comment.