mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Challenge grid population improvement
* Correctly identify that two columns with only one major unlock will have 6 empty tile slots, not two. This will result in less underutilised Challenges grid space.
This commit is contained in:
parent
06e7eb3567
commit
20b6a8389b
1 changed files with 10 additions and 4 deletions
14
src/m_cond.c
14
src/m_cond.c
|
|
@ -97,21 +97,27 @@ void M_PopulateChallengeGrid(void)
|
|||
{
|
||||
// Getting the number of 2-highs you can fit into two adjacent columns.
|
||||
UINT8 majorpad = (CHALLENGEGRIDHEIGHT/2);
|
||||
majorpad = (nummajorunlocks+1)/majorpad;
|
||||
numempty = nummajorunlocks%majorpad;
|
||||
majorpad = (nummajorunlocks+(majorpad-1))/majorpad;
|
||||
|
||||
gamedata->challengegridwidth = majorpad*2;
|
||||
numempty *= 4;
|
||||
|
||||
#if (CHALLENGEGRIDHEIGHT % 2)
|
||||
// One empty per column.
|
||||
numempty = gamedata->challengegridwidth;
|
||||
// One extra empty per column.
|
||||
numempty += gamedata->challengegridwidth;
|
||||
#endif
|
||||
|
||||
//CONS_Printf("%d major unlocks means width of %d, numempty of %d\n", nummajorunlocks, gamedata->challengegridwidth, numempty);
|
||||
}
|
||||
|
||||
if (numunlocks > numempty)
|
||||
{
|
||||
// Getting the number of extra columns to store normal unlocks
|
||||
gamedata->challengegridwidth += ((numunlocks - numempty) + (CHALLENGEGRIDHEIGHT-1))/CHALLENGEGRIDHEIGHT;
|
||||
UINT16 temp = ((numunlocks - numempty) + (CHALLENGEGRIDHEIGHT-1))/CHALLENGEGRIDHEIGHT;
|
||||
gamedata->challengegridwidth += temp;
|
||||
majorcompact = 1;
|
||||
//CONS_Printf("%d normal unlocks means %d extra entries, additional width of %d\n", numunlocks, (numunlocks - numempty), temp);
|
||||
}
|
||||
else if (challengegridloops)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue