Fix FindSendPropOffs with SendPropArray props (#1708)

FindSendPropOffs is deprecated and FindSendPropInfo behaves correctly
here, but there are still a lot of old plugins using FindSendPropOffs.
One of the SendPropArray props broken by the changes here is
m_hViewModel which there are known plugins in the wild accessing.
This commit is contained in:
Asher Baker 2022-02-06 15:56:52 +00:00 committed by Your Name
parent e03320c80e
commit c206ac3099

View File

@ -818,6 +818,12 @@ static cell_t FindSendPropOffs(IPluginContext *pContext, const cell_t *params)
return -1;
}
// Before we added support for DPT_Array props, FindInSendTable would have given us the inner array prop itself.
// To maintain compatibility with older plugins still using us, pluck out the inner array prop ourselves.
if (pSend->GetType() == DPT_Array && pSend->GetArrayProp()) {
return pSend->GetArrayProp()->GetOffset();
}
return pSend->GetOffset();
}