Re: Allocating memory in unix vs. windows

From: Jake Turner (jakehturner@hotmail.com)
Date: 03/20/01


Ohh, i just realised i may be on completely the wrong trail..

I think the error might be in the mapping code, because when you sail to
that place the error occures too...

So ill show you the code that prints out the map of the ocean to the player
and see if you can spot what might be doing it.. cause i can't... again the
problem occurs in linux but not windows...

########################################################################

char map[25][15][10];
        int x, y, i, j;
        struct ocean_land_mark_data *olm;

        x = land_mark->x;
        y = land_mark->y;


        sprintf(buf, "%s\r\n", land_mark->name);
        sprintf(buf + strlen(buf), "&c(X-%d, Y-%d)&n\r\n", x, y);
        send_to_char(GET_COLOR(ch, COLOR_ROOMNAME), ch);
        send_to_char(buf, ch);
        send_to_char(CCNRM(ch, C_NRM), ch);

        /* Begin filling map with correct symbols */

        /* Default map with plain sea */
        for(j = 0; j < 11; j++)
        {
                for(i = 0; i < 21; i++)
                        strcpy(map[i][j], "&b~&n");

                strcpy(map[21][j], "\r\n");
        }

        /* Show up all land_marks */
        for(olm = top_of_land_marks; olm; olm = olm->next)
                if(olm->x > (x - 12) && olm->x < (x + 12) &&
                   olm->y > (y - 7) && olm->y < (y + 7))
        strcpy(map[10 - (x - olm->x)] [5 - (y - olm->y)], olm->symbol);

        strcpy(map[10][5], land_mark->symbol);

        send_to_char("&w#####OCEAN EDITOR######\r\n&n", ch);

        for(j = 10; j >= 0; j--)
        {
                send_to_char("&w#&n", ch);
                for(i = 0; i < 21; i++)
                    send_to_char(map[i][j], ch);

                send_to_char("&w#&n\r\n", ch);
        }

       send_to_char("&w#####OCEAN EDITOR######\r\n&n", ch);
}


####################################################################


Anyone any ideas?

- Culhaven (telnet://mercator.mudhaven.com:2411)

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/04/01 PST