summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-06-15 22:52:01 +0200
committerneoraider <devnull@localhost>2007-06-15 22:52:01 +0200
commitcfa4f3beefabc5cd4e678008b5b3a2bf3fe95a52 (patch)
tree5d68c773e0a21f0d9f1cf195a515e380d9259076
parentf5c8fc72ca1801a7771a75d652c58754b36db768 (diff)
downloadlibzoom-cfa4f3beefabc5cd4e678008b5b3a2bf3fe95a52.tar
libzoom-cfa4f3beefabc5cd4e678008b5b3a2bf3fe95a52.zip
zoom: Fixed some Makefile bugs.
-rw-r--r--level.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/level.c b/level.c
index 73ed1fc..cd703a7 100644
--- a/level.c
+++ b/level.c
@@ -627,35 +627,46 @@ void FreeLevel(LEVEL *level) {
if(level) {
if(level->info) {
- free(level->info->name);
- free(level->info->desc);
+ if(level->info->name)
+ free(level->info->name);
+
+ if(level->info->desc)
+ free(level->info->desc);
+
free(level->info);
}
- if(level->nRooms) {
+ if(level->rooms) {
for(i = 0; i < level->nRooms; i++) {
- if(level->rooms[i].nWalls) free(level->rooms[i].walls);
+ if(level->rooms[i].walls)
+ free(level->rooms[i].walls);
/*if(level->rooms[i].nThings) free(level->rooms[i].things);
if(level->rooms[i].nGates) {
free(level->rooms[i].gates);
free(level->rooms[i].gateinfo);
}*/
- free(level->rooms[i].id);
+ if(level->rooms[i].id)
+ free(level->rooms[i].id);
}
+
free(level->rooms);
}
- if(level->nGates) {
+ if(level->gates) {
for(i = 0; i < level->nGates; i++) {
- if(level->gates[i].nWalls) free(level->gates[i].walls);
+ if(level->gates[i].walls)
+ free(level->gates[i].walls);
}
+
free(level->gates);
}
- if(level->nTextures) {
- for(i = 0; i < level->nTextures; i++)
- free(level->textures[i].name);
+ if(level->textures) {
+ for(i = 0; i < level->nTextures; i++) {
+ if(level->textures[i].name)
+ free(level->textures[i].name);
+ }
free(level->textures);
}