Server Help

ASSS Questions - mapnewsdl.c

L.C. - Sun Mar 07, 2010 12:00 pm
Post subject: mapnewsdl.c
Code: Show/Hide
   if (!data)
   {
      /* emergency hardcoded map: */
      byte emergencymap[] =
      {
         0x2a, 0x74, 0x69, 0x6e, 0x79, 0x6d, 0x61, 0x70,
         0x2e, 0x6c, 0x76, 0x6c, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x78, 0x9c, 0x63, 0x60, 0x60, 0x60, 0x04,
         0x00, 0x00, 0x05, 0x00, 0x02
      };

      lm->LogA(L_WARN, "mapnewsdl", arena, "can't load level file, falling back to tinymap.lvl");
      data = amalloc(sizeof(*data));
      data->checksum = 0x5643ef8a;
      data->uncmplen = 4;
      data->cmplen = sizeof(emergencymap);
      data->cmpmap  = amalloc(sizeof(emergencymap));
      memcpy(data->cmpmap, emergencymap, sizeof(emergencymap));
      astrncpy(data->filename, "tinymap.lvl", sizeof(data->filename));
   }

This results in tinymap.lvl with HEX data 00 00 00 01.

This is what I want to do: change it to either 00 00 00 00 (uses no tile instead of Tile#1) or 00 00 00 FE (uses Tile#254 instead of Tile#1), depending on the first choice working or not.

Could someone explain to me how this code works, line for line, and what it does?

I also want to change tinymap.lvl to _blank.lvl or _asss.lvl, but I think this is as easy as replacing "tinymap" with "_blank" or "_asss".
Dr Brain - Sun Mar 07, 2010 12:42 pm
Post subject:
Most likely the map has been compressed with zlib.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group