L.C. Server Help Squatter
Age:33 Gender: Joined: Jan 03 2003 Posts: 574 Location: Missouri, US Offline
|
Posted: Sun Mar 07, 2010 12:00 pm Post subject: mapnewsdl.c |
|
|
|
|
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". |
|