--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
#include "classes.h"
|
|
|
|
// 0082d290
|
|
void * Spawn::PickEntry(float value)
|
|
{
|
|
uint8_t entryIndex;
|
|
float weightSum;
|
|
|
|
entryIndex = 0;
|
|
weightSum = 0.0;
|
|
if (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + 8)) != 0) {
|
|
do {
|
|
weightSum = weightSum + *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4)) + 8 + GHIDRA_UINT(entryIndex) * 0xc));
|
|
if (value * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) < weightSum) {
|
|
return (void *)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4)) + GHIDRA_UINT(entryIndex) * 0xc);
|
|
}
|
|
entryIndex = entryIndex + 1;
|
|
} while (entryIndex < *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + 8)));
|
|
}
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[warn] RoomConfig::Spawn::PickEntry did not terminate properly. Picking first entry: (%d, %d, %d, %f)\n"
|
|
);
|
|
return *(void **)(GHIDRA_CAST<char *>(this) + 4);
|
|
}
|
|
|
|
// 00872000
|
|
void Spawn::Entries(uint32_t *param_1, int param_2)
|
|
{
|
|
*param_1 = GHIDRA_UINT(*GHIDRA_CAST<uint8_t *>((param_2 + 8)));
|
|
param_1[1] = *GHIDRA_CAST<uint32_t *>((param_2 + 4));
|
|
return;
|
|
}
|