Automatic allocation of 255 maps on startup.

This commit is contained in:
Ryan "Lofenyy" Medeiros 2023-07-02 00:12:42 -06:00
parent a6ff74eac8
commit 3311aa2873
1 changed files with 2 additions and 14 deletions

View File

@ -347,20 +347,8 @@ int turnTip()
// Allocate memory for our internal map
int newMap()
{
char buffer[16] = "";
uint_fast8_t n = 0;
echo();
// While we don't have a nonzero answer
while (n == 0)
{
// Prompt for the number of maps we want
mvprintw(1, 0, "How many maps would you like to allocate? ");
getnstr(buffer, 16);
n = atoi(buffer);
}
uint_fast8_t n = 255;
// Allocate the needed memory
map = malloc(n * sizeof(struct maps));