Fix possible crash in older Fantasia data, formatting fixes.
This commit is contained in:
parent
097078288d
commit
b9ca730dca
@ -479,7 +479,12 @@ class PopnMusicFantasia(PopnMusicBase):
|
||||
self.GAME_CHART_TYPE_NORMAL: self.CHART_TYPE_NORMAL,
|
||||
self.GAME_CHART_TYPE_HYPER: self.CHART_TYPE_HYPER,
|
||||
self.GAME_CHART_TYPE_EX: self.CHART_TYPE_EX,
|
||||
}[node.child_value("sheet")]
|
||||
}.get(node.child_value("sheet"))
|
||||
if chart is None:
|
||||
# Some old versions of Fantasia still send empty chart data for Tune Street
|
||||
# charts that don't exist in the game. Ignore these or we end up crashing on
|
||||
# profile save.
|
||||
continue
|
||||
medal = (node.child_value("n_data") >> (chart * 4)) & 0x000F
|
||||
medal = {
|
||||
self.GAME_PLAY_MEDAL_CIRCLE_FAILED: self.PLAY_MEDAL_CIRCLE_FAILED,
|
||||
|
@ -1134,7 +1134,9 @@ class TXP2File(TrackedCoverage, VerboseOutput):
|
||||
|
||||
if feature_mask & 0xFFF00000:
|
||||
# We don't know these bits at all!
|
||||
raise Exception(f"Invalid bits set in feature mask {hex(feature_mask & 0xFFF80000)}!")
|
||||
raise Exception(
|
||||
f"Invalid bits set in feature mask {hex(feature_mask & 0xFFF80000)}!"
|
||||
)
|
||||
|
||||
if header_offset != header_length:
|
||||
raise Exception("Failed to parse bitfield of header correctly!")
|
||||
|
Loading…
Reference in New Issue
Block a user