Merge branch 'main' into raw-parsing-for-scene-data

This commit is contained in:
Aaron Kimbrell
2025-10-17 09:20:13 -05:00
12 changed files with 194 additions and 78 deletions

View File

@@ -93,17 +93,19 @@ std::map<LOT, LootDropInfo> RollLootMatrix(uint32_t matrixIndex) {
// Generates a 'random' final position for the loot drop based on its input spawn position.
void CalcFinalDropPos(GameMessages::DropClientLoot& lootMsg) {
lootMsg.bUsePosition = true;
if (lootMsg.spawnPos != NiPoint3Constant::ZERO) {
lootMsg.bUsePosition = true;
//Calculate where the loot will go:
uint16_t degree = GeneralUtils::GenerateRandomNumber<uint16_t>(0, 360);
//Calculate where the loot will go:
uint16_t degree = GeneralUtils::GenerateRandomNumber<uint16_t>(0, 360);
double rad = degree * 3.14 / 180;
double sin_v = sin(rad) * 4.2;
double cos_v = cos(rad) * 4.2;
double rad = degree * 3.14 / 180;
double sin_v = sin(rad) * 4.2;
double cos_v = cos(rad) * 4.2;
const auto [x, y, z] = lootMsg.spawnPos;
lootMsg.finalPosition = NiPoint3(static_cast<float>(x + sin_v), y, static_cast<float>(z + cos_v));
const auto [x, y, z] = lootMsg.spawnPos;
lootMsg.finalPosition = NiPoint3(static_cast<float>(x + sin_v), y, static_cast<float>(z + cos_v));
}
}
// Visually drop the loot to all team members, though only the lootMsg.ownerID can pick it up