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.

master
kts 2013-12-24 06:01:43 -08:00
parent d5f4947c90
commit f2422fdada
5 changed files with 35 additions and 13 deletions

1
data.h
View File

@ -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.
*/

View File

@ -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++) {

View File

@ -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

View File

@ -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 {

View File

@ -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