Skip to content

Commit

Permalink
Fixed casting wrapper's object.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolftein committed Mar 4, 2024
1 parent 5a36bc7 commit 07d0f64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Source/Private/Core/COM_Common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,14 @@ inline namespace Proxy

// -=(Undocumented)=-
template<typename Base, typename Class>
static auto & CCast(Class Instance)
static auto CCast(Class Instance)
{
return reinterpret_cast<Ptr<Base>>(Instance)->Internal_Get();
}

// -=(Undocumented)=-
template<typename Base, typename Class>
static auto & CCastObject(Class Instance)
{
return reinterpret_cast<Ptr<Base>>(Instance)->Internal_Get();
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Private/Network/COM_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ inline namespace COM

HRESULT Network_Client::Write(BinaryWriter_ * Message)
{
CPtr<const UInt08> Data = CCast<BinaryWriter>(Message).GetData();
CPtr<const UInt08> Data = CCastObject<BinaryWriter>(Message).GetData();
mWrapper->Write(Data);
return S_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Private/Network/COM_Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ inline namespace COM

HRESULT Network_Server::Broadcast(BinaryWriter_ * Message)
{
mWrapper->Broadcast<UInt08>(CCast<BinaryWriter>(Message).GetData());
mWrapper->Broadcast<UInt08>(CCastObject<BinaryWriter>(Message).GetData());
return S_OK;
}

Expand Down

0 comments on commit 07d0f64

Please sign in to comment.