Fix #395 backward compatibility issue by adding SetParamEntity2 native (#463)

This commit is contained in:
Vincent Herbet
2017-10-05 11:46:05 +02:00
committed by GitHub
parent 97df408d51
commit 779a4d9e59
3 changed files with 39 additions and 12 deletions

View File

@@ -210,7 +210,7 @@ public:
return 0;
};
int SetEntity(cell *data)
int SetEntity(cell *data, bool updateIndex = false)
{
if (!IsSet())
{
@@ -219,7 +219,7 @@ public:
if (IsType(RET_CBASE))
{
*(reinterpret_cast<void **>(m_data))= TypeConversion.id_to_cbase(*data);
if (m_index != 0)
if (updateIndex && m_index)
{
*m_index=*data;
}
@@ -229,7 +229,7 @@ public:
else if (IsType(RET_ENTVAR))
{
*(reinterpret_cast<entvars_t **>(m_data))= TypeConversion.id_to_entvars(*data);
if (m_index != 0)
if (updateIndex && m_index)
{
*m_index=*data;
}
@@ -239,7 +239,7 @@ public:
else if (IsType(RET_EDICT))
{
*(reinterpret_cast<edict_t **>(m_data)) = TypeConversion.id_to_edict(*data);
if (m_index != 0)
if (updateIndex && m_index)
{
*m_index = *data;
}