Increase maximum WAD and skin counts
I've discussed this with @SinnamonLat before, unfortunately too close to 1.4's release. WAD and skin indices can safely use UINT8 values, so long as the limits for both are lower than 256. I can attest from experience that having 255 or 254 WAD slots works fine, and I have checked that having 255 skin slots works by saving a replay with 139 skins available, 133th skin in use in freeplay, then playing it back and letting the addons load. As such, I'm increasing the limit for both to 255 – though I'm open to further changes to both limits, so long as neither goes far below 255. This also serves as futureproofing for Ring Racers, which will make bonuschars.kart part of the core WADs and thus reduce the amount of available character slots for servers like Original Server: Do Not Steal.
If you're wondering who would use 255 WADs or 255 skins, remember that the NVJR custom build exists and people use it.
This introduces an obvious netgame incompatibility for servers, thus I'm filing this MR for next
, but clients can use this change to load music WADs on a server that's maxed out on WAD slots while staying compatible, which is why this branch is based on master
.
EDIT 1: Fixed some phrasing and grammar.
EDIT 2: Updated for the limit being bumped again to 255. Sorry about WAD_MUSIC, himie, you'll have to find another workaround, drop that trick, merge futurepk3 and/or help backporting addfolder
.
Merge request reports
Activity
- Resolved by X.organic
Won't +1 unless
MAX_WADFILES 255
. Dunno whatMUSIC_WAD
is, but sounds kind of janky and we shouldn't be honoring it ... Moe should figure out their own solution for that. :V
@TehRealSalt Fair enough, I will edit it. It's a trick used in Moe Mansion that allocates an extra WAD file for loading independent music files as lumps. I think I should drop that trick, especially since futurepk3 – or a hypothetical backport of SRB2's
addfolder
– would eliminate the need for it.- Resolved by X.organic
Gonna add this, I would be careful when it comes to increasing max skins, some of the variables that touch
MAXSKINS
are only 8 bit, and will end up with an endless loop within for loops where the iterator variable is too small to hold a value over 255 if not accounted for.A number like 253 or less would be safe from what I remember. Maybe 250 just to keep it round.
Edited by Callmore
mentioned in commit 9160c6be
mentioned in merge request !295 (merged)
mentioned in commit nerdyminer18/srb-2@5d96abdd
mentioned in merge request SinnamonLat/SRB2!9 (merged)