diff options
author | B. Stack <bgstack15@gmail.com> | 2024-03-28 15:43:06 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2024-03-28 15:43:06 -0400 |
commit | bd9401fcf585d9d809e4ab2bff9887a7dd1a72a2 (patch) | |
tree | 9765a59b308f82b5df4e841d1c57259ede388a71 | |
parent | get-level-info: add breakables data (diff) | |
download | srb_lib-bd9401fcf585d9d809e4ab2bff9887a7dd1a72a2.tar.gz srb_lib-bd9401fcf585d9d809e4ab2bff9887a7dd1a72a2.tar.bz2 srb_lib-bd9401fcf585d9d809e4ab2bff9887a7dd1a72a2.zip |
simplify breakables formula
Thanks to trendlines in LibreOffice Calc because I have forgotten
basic algebra.
-rw-r--r-- | srb_lib.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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] |