CLink: Resolve sign conversion warnings

This commit is contained in:
Lioncash 2020-06-12 16:46:49 -04:00
parent 38d245b460
commit 5c42bcc580
1 changed files with 14 additions and 8 deletions

View File

@ -81,25 +81,31 @@ public:
, mReceiverID(ReceiverID)
{}
void SetSender(uint32 NewSenderID, uint32 Index = -1)
void SetSender(uint32 NewSenderID, uint32 Index = UINT32_MAX)
{
uint32 OldSenderID = mSenderID;
const uint32 OldSenderID = mSenderID;
CScriptObject *pOldSender = mpArea->InstanceByID(OldSenderID);
CScriptObject *pNewSender = mpArea->InstanceByID(NewSenderID);
mSenderID = NewSenderID;
if (pOldSender) pOldSender->RemoveLink(ELinkType::Outgoing, this);
if (pOldSender)
pOldSender->RemoveLink(ELinkType::Outgoing, this);
pNewSender->AddLink(ELinkType::Outgoing, this, Index);
}
void SetReceiver(uint32 NewReceiverID, uint32 Index = -1)
void SetReceiver(uint32 NewReceiverID, uint32 Index = UINT32_MAX)
{
uint32 OldReceiverID = mSenderID;
const uint32 OldReceiverID = mSenderID;
CScriptObject *pOldReceiver = mpArea->InstanceByID(OldReceiverID);
CScriptObject *pNewReceiver = mpArea->InstanceByID(NewReceiverID);
mReceiverID = NewReceiverID;
if (pOldReceiver) pOldReceiver->RemoveLink(ELinkType::Incoming, this);
if (pOldReceiver)
pOldReceiver->RemoveLink(ELinkType::Incoming, this);
pNewReceiver->AddLink(ELinkType::Incoming, this, Index);
}
@ -116,7 +122,7 @@ public:
}
}
return -1;
return UINT32_MAX;
}
uint32 ReceiverIndex() const
@ -132,7 +138,7 @@ public:
}
}
return -1;
return UINT32_MAX;
}
// Operators