From 16bff525754efe53adecf798e24084dd0c639b63 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Wed, 13 Aug 2025 11:51:35 -0700 Subject: [PATCH] update comments in expand_rate --- src/RareItemSet.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/RareItemSet.cc b/src/RareItemSet.cc index e92e4ca3..5acd4d8b 100644 --- a/src/RareItemSet.cc +++ b/src/RareItemSet.cc @@ -28,11 +28,10 @@ string RareItemSet::ExpandedDrop::str(shared_ptr name_index } uint32_t RareItemSet::expand_rate(uint8_t pc) { - // To compute the actual drop rare drop rate from pc, first decode pc into - // shift and value: + // To compute the actual rare drop rate from pc, first decode pc: // pc = bits SSSSSVVV - // shift = S - 4 (so shift is 0-27) - // value = V + 7 (so value is 7-14) + // shift = S - 4 (so shift is 0-27) + // value = V + 7 (so value is 7-14) // Then, take the value 0x00000002, shift it left by shift (0-27), and // multiply the result by value (7-14) to get the actual drop rate. The result // is a probability out of 0xFFFFFFFF (so 0x40000000 means the item will drop