From 710cfc8154510c4562e7ea69adcff9b297834140 Mon Sep 17 00:00:00 2001 From: jonschz Date: Sat, 23 Nov 2024 10:20:12 +0100 Subject: [PATCH] Implement `LegoRaceCar::FUN_10012e00()` --- LEGO1/lego/legoomni/src/race/legoracers.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/LEGO1/lego/legoomni/src/race/legoracers.cpp b/LEGO1/lego/legoomni/src/race/legoracers.cpp index 705b3eb2..a313c610 100644 --- a/LEGO1/lego/legoomni/src/race/legoracers.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracers.cpp @@ -180,11 +180,16 @@ void LegoRaceCar::FUN_10012de0() g_unk0x100f0b88 = 0; } -// STUB: LEGO1 0x10012e00 -// STUB: BETA10 0x100cb129 +// FUNCTION: LEGO1 0x10012e00 +// FUNCTION: BETA10 0x100cb129 void LegoRaceCar::FUN_10012e00() { - // TODO + // Note the (likely unintentional) order of operations: `%` is executed before `/`, + // so the division is performed at runtime. + g_srtsl18to29Index = rand() % sizeof(g_srtsl18to29) / sizeof(g_srtsl18to29[0]); + g_srtsl6to10Index = rand() % sizeof(g_srtsl6to10) / sizeof(g_srtsl6to10[0]); + g_emptySoundKeyListIndex = rand() % sizeof(g_emptySoundKeyList) / sizeof(g_emptySoundKeyList[0]); + g_srtrhIndex = rand() % sizeof(g_srtrh) / sizeof(g_srtrh[0]); } // FUNCTION: LEGO1 0x10012e60