Automatic allocation of 255 maps on startup.
This commit is contained in:
parent
a6ff74eac8
commit
3311aa2873
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in New Issue