[Scummvm-git-logs] scummvm master -> cc698a8882d514339baff84220c35f3151370e83

elasota noreply at scummvm.org
Sun Jan 14 20:53:49 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
cc698a8882 MTROPOLIS: Fix list shuffle not shuffling the first element


Commit: cc698a8882d514339baff84220c35f3151370e83
    https://github.com/scummvm/scummvm/commit/cc698a8882d514339baff84220c35f3151370e83
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2024-01-14T15:53:04-05:00

Commit Message:
MTROPOLIS: Fix list shuffle not shuffling the first element

Changed paths:
    engines/mtropolis/plugin/standard.cpp


diff --git a/engines/mtropolis/plugin/standard.cpp b/engines/mtropolis/plugin/standard.cpp
index 5dbed826cfd..f83c1ec1a35 100644
--- a/engines/mtropolis/plugin/standard.cpp
+++ b/engines/mtropolis/plugin/standard.cpp
@@ -999,8 +999,8 @@ bool ListVariableModifier::readAttribute(MiniscriptThread *thread, DynamicValue
 
 		size_t listSize = storage->_list->getSize();
 		for (size_t i = 1; i < listSize; i++) {
-			size_t sourceIndex = i;
-			size_t destIndex = sourceIndex + rng->getRandomNumber(static_cast<uint>(listSize - 1 - i));
+			size_t sourceIndex = i - 1;
+			size_t destIndex = sourceIndex + rng->getRandomNumber(static_cast<uint>(listSize - i));
 			if (sourceIndex != destIndex) {
 				DynamicValue srcValue;
 				DynamicValue destValue;




More information about the Scummvm-git-logs mailing list