CON: Fix two regressions completely breaking the correctness of the copy command, introduced in r6343.

git-svn-id: https://svn.eduke32.com/eduke32@6898 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2018-05-23 05:58:03 +00:00
parent 749d79dcdd
commit 064ff3a403

View file

@ -5075,27 +5075,38 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop)
{
case 0:
for (; numElements > 0; --numElements)
aGameArrays[destArray].pValues[destArrayIndex += destInc] = Gv_GetArrayValue(srcArray, srcArrayIndex += srcInc);
{
aGameArrays[destArray].pValues[destArrayIndex] = Gv_GetArrayValue(srcArray, srcArrayIndex++);
destArrayIndex += destInc;
}
break;
case GAMEARRAY_INT16:
for (; numElements > 0; --numElements)
((int16_t *)aGameArrays[destArray].pValues)[destArrayIndex += destInc]
= Gv_GetArrayValue(srcArray, srcArrayIndex += srcInc);
{
((int16_t *) aGameArrays[destArray].pValues)[destArrayIndex] = Gv_GetArrayValue(srcArray, srcArrayIndex++);
destArrayIndex += destInc;
}
break;
case GAMEARRAY_INT8:
for (; numElements > 0; --numElements)
((int8_t *)aGameArrays[destArray].pValues)[destArrayIndex += destInc]
= Gv_GetArrayValue(srcArray, srcArrayIndex += srcInc);
{
((int8_t *) aGameArrays[destArray].pValues)[destArrayIndex] = Gv_GetArrayValue(srcArray, srcArrayIndex++);
destArrayIndex += destInc;
}
break;
case GAMEARRAY_UINT16:
for (; numElements > 0; --numElements)
((uint16_t *)aGameArrays[destArray].pValues)[destArrayIndex += destInc]
= Gv_GetArrayValue(srcArray, srcArrayIndex += srcInc);
{
((uint16_t *) aGameArrays[destArray].pValues)[destArrayIndex] = Gv_GetArrayValue(srcArray, srcArrayIndex++);
destArrayIndex += destInc;
}
break;
case GAMEARRAY_UINT8:
for (; numElements > 0; --numElements)
((uint8_t *)aGameArrays[destArray].pValues)[destArrayIndex += destInc]
= Gv_GetArrayValue(srcArray, srcArrayIndex += srcInc);
{
((uint8_t *) aGameArrays[destArray].pValues)[destArrayIndex] = Gv_GetArrayValue(srcArray, srcArrayIndex++);
destArrayIndex += destInc;
}
break;
}