added getTileDataById to data.h, as it was causing segfaults on gcc 4.2.1, mac os 10.6.8/x86 without it. Also fixed pack_data.c, as it was attempting to load the tile data directory before checking argc if an arg was passed. Also added equipment to ibexian shocktrooper and barbarian in xibalba/players for additional testing.
parent
d5f4947c90
commit
f2422fdada
1
data.h
1
data.h
|
@ -27,6 +27,7 @@ struct Data {
|
|||
};
|
||||
|
||||
struct TileData *getTileDataByKey(struct Data *data, char *key);
|
||||
struct TileData *getTileDataById(struct Data *data, int tileset_id, int tile_id);
|
||||
/*
|
||||
Sets work by having a basic linear TileData pointer array wherein tiles are referenced by their IDs. In addition to this, to allow for accessing tiles by name, a Table is used that provides a name->id table.
|
||||
*/
|
||||
|
|
26
pack_data.c
26
pack_data.c
|
@ -50,20 +50,20 @@ char files[FILE_COUNT][15] = {
|
|||
|
||||
int main(int argc, char **argv) {
|
||||
printf("%s\n", TITLE);
|
||||
char *buffer;
|
||||
char file_name[63];
|
||||
char final_file[63];
|
||||
sprintf(final_file, "%s/%s.tsd", argv[1], argv[1]);
|
||||
|
||||
remove(final_file);
|
||||
|
||||
FILE *output_file = fopen(final_file, "w");
|
||||
if (output_file == NULL) {
|
||||
printf(CANNOT_WRITE, final_file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
char *buffer;
|
||||
char file_name[63];
|
||||
char final_file[63];
|
||||
sprintf(final_file, "%s/%s.tsd", argv[1], argv[1]);
|
||||
|
||||
remove(final_file);
|
||||
|
||||
FILE *output_file = fopen(final_file, "w");
|
||||
if (output_file == NULL) {
|
||||
printf(CANNOT_WRITE, final_file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf(PROCESSING, argv[1]);
|
||||
int i;
|
||||
for (i = 0;i < FILE_COUNT;i++) {
|
||||
|
|
|
@ -49,12 +49,19 @@ name shock trooper
|
|||
race ibexian
|
||||
stats S10D8C10I6W6c6
|
||||
slots H1F1N2S2A2a2h2D8w2T1W1L2l2o2
|
||||
equipment {
|
||||
large macana, 1, 100.0
|
||||
}
|
||||
}
|
||||
17 {
|
||||
name barbarian
|
||||
race ibexian
|
||||
stats S12D10C10I4W4c4
|
||||
slots H1F1N2S2A2a2h2D8w2T1W1L2l2o2
|
||||
equipment {
|
||||
large macana, 1, 100.0
|
||||
cloth armour, 1, 100.0
|
||||
}
|
||||
}
|
||||
18 {
|
||||
name warrior
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
race ibexian
|
||||
stats S10D8C10I6W6c6
|
||||
slots H1F1N2S2A2a2h2D8w2T1W1L2l2o2
|
||||
equipment {
|
||||
large macana, 1, 100.0
|
||||
}
|
||||
}
|
||||
|
||||
17 {
|
||||
|
@ -29,6 +32,10 @@
|
|||
race ibexian
|
||||
stats S12D10C10I4W4c4
|
||||
slots H1F1N2S2A2a2h2D8w2T1W1L2l2o2
|
||||
equipment {
|
||||
large macana, 1, 100.0
|
||||
cloth armour, 1, 100.0
|
||||
}
|
||||
}
|
||||
|
||||
18 {
|
||||
|
|
|
@ -49,12 +49,19 @@ name shock trooper
|
|||
race ibexian
|
||||
stats S10D8C10I6W6c6
|
||||
slots H1F1N2S2A2a2h2D8w2T1W1L2l2o2
|
||||
equipment {
|
||||
large macana, 1, 100.0
|
||||
}
|
||||
}
|
||||
17 {
|
||||
name barbarian
|
||||
race ibexian
|
||||
stats S12D10C10I4W4c4
|
||||
slots H1F1N2S2A2a2h2D8w2T1W1L2l2o2
|
||||
equipment {
|
||||
large macana, 1, 100.0
|
||||
cloth armour, 1, 100.0
|
||||
}
|
||||
}
|
||||
18 {
|
||||
name warrior
|
||||
|
|
Loading…
Reference in New Issue