Commit 5facfef3 authored by Dino Bollinger's avatar Dino Bollinger Committed by Richard Gobeille

Duke3D: Fix setarraysequence by removing superfluous bounds check.

The condition inside VM_Assert always returned false because
`ResizeArray()` ensures that `sequenceSize == aGameArrays[arrayNum].size`.
parent 9e775824
......@@ -5660,10 +5660,9 @@ badindex:
int32_t const arrayNum = *insptr++;
int32_t const sequenceSize = *insptr++;
ResizeArray(arrayNum, sequenceSize);
VM_ASSERT((unsigned)arrayNum < (unsigned)g_gameArrayCount, "invalid array %d\n", arrayNum);
VM_ASSERT((unsigned)arrayNum < (unsigned)g_gameArrayCount && (unsigned)sequenceSize < (unsigned)aGameArrays[arrayNum].size,
"invalid array %d or index %d\n", arrayNum, sequenceSize);
ResizeArray(arrayNum, sequenceSize);
for (int arrayIndex = 0; arrayIndex < sequenceSize; ++arrayIndex)
SetArray(arrayNum, arrayIndex, Gv_GetVar(*insptr++));
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment