From bd9401fcf585d9d809e4ab2bff9887a7dd1a72a2 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Thu, 28 Mar 2024 15:43:06 -0400 Subject: simplify breakables formula Thanks to trendlines in LibreOffice Calc because I have forgotten basic algebra. --- srb_lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srb_lib.py b/srb_lib.py index d8226c5..09c9d26 100644 --- a/srb_lib.py +++ b/srb_lib.py @@ -383,7 +383,7 @@ def get_collected_breakables(data_object,profile_id, level, silent=False): #print(f"debug (get_collected_breakables): got level_obj, message {level_obj}, {message}") levelset_obj, message = get_levelset_info(level_obj["setid"]) pos_level_balloons = PROFILE_START_POSITION[profile_id]+POS_LEVEL_BALLOONS+(level_obj["setid"]*POS_LEVEL_BALLOONS_MULTIPLIER_LEVELSET)+(POS_LEVEL_BALLOONS_MULTIPLIER_LEVEL*level_obj["set_pos"]) - pos_level_breakables = pos_level_balloons + (int(((INT_SIZE-levelset_obj["id"])*INT_SIZE+INT_SIZE)/2) + 2) * INT_SIZE + pos_level_breakables = pos_level_balloons + ((-2 * levelset_obj["id"]) + 12) * INT_SIZE pos_level_which_breakables = pos_level_breakables + INT_SIZE profile_level_breakables = struct.unpack_from('<1I',data,pos_level_breakables)[0] profile_level_which_breakables = struct.unpack_from('<1I',data,pos_level_which_breakables)[0] -- cgit