MontyTRC89 / Tomb-Editor

Tomb Editor
57 stars 16 forks source link

Fix (and de-harcode) texture sounds "limit" when loading a PRJ2 #815

Closed Joey79100 closed 4 months ago

Joey79100 commented 5 months ago

This fixes #814 : loading a PRJ2 was discarding any texture sound ID above 15.

This PR "raises the limit", and also de-hardcodes it by referring to the enum's length instead. However I'm not sure if it's ok to de-hardcode: I don't know anything about chunks, so I'm not sure why this check was added in the beginning, maybe there's something I'm not seeing.

Just in case de-hardcoding is a bad idea, I first commited the "limit raise" from 15 to 22, then I commited the de-harcoding (so you can still cherry-pick the 1st one).