[Fix] Pack file was using logical operator instead of asignment. :/

This commit is contained in:
Allanis 2013-02-07 22:48:31 +00:00
parent c15699606b
commit 2e78211acd
3 changed files with 23 additions and 28 deletions

View File

@ -19,4 +19,8 @@ joystick = "Precision"
accel = { type = "jbutton", key = 0 } accel = { type = "jbutton", key = 0 }
left = { type = "jaxis", key = 0 } left = { type = "jaxis", key = 0 }
right = { type = "jaxis", key = 0 } right = { type = "jaxis", key = 0 }
primary = { type = "jbutton", key = 1 }
target = { type = "jbutton", key = 4 }
mapzoomin = { type = "jbutton", key = 7 }
mapzoomout = { type = "jbuton", key = 6 }

View File

@ -1,22 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Factions> <Factions>
<faction id='1'> <faction name = "Player">
<name>Player</name>
</faction> </faction>
<faction id='2'> <faction name = "Merchant">
<name>Noob Merchant</name> </faction>
<faction name = "Pirate">
</faction>
<alliances>
</alliances>
<enemies> <enemies>
<enemy>'3'</enemy>
</enemies> </enemies>
<allies>
</allies>
</faction>
<faction id='3'>
<name>Pirate</name>
<enemies>
<enemy>2</enemy>
</enemies>
<allies>
</allies>
</faction>
</Factions> </Factions>

View File

@ -291,12 +291,6 @@ void* pack_readfile(const char* packfile, const char* filename, uint32_t* filesi
return buf; return buf;
} }
// Close the packfile.
int pack_close(Packfile* file) {
int i = close(file->fd);
return (i) ? -1 : 0;
}
// Load the filenames int the packfile to filenames. // Load the filenames int the packfile to filenames.
// filenames should be freed after use // filenames should be freed after use
// On error if filenames is (char**)-1. // On error if filenames is (char**)-1.
@ -332,8 +326,14 @@ void pack_listfiles(const char* packfile, char** filenames, uint32_t* nfiles) {
while(filenames[i][j++] != '\0') while(filenames[i][j++] != '\0')
READ(fd, &filenames[i][j], 1); READ(fd, &filenames[i][j], 1);
} }
filenames[i] == NULL; filenames[i] = NULL;
close(fd); close(fd);
} }
#undef READ #undef READ
// Close the packfile.
int pack_close(Packfile* file) {
int i = close(file->fd);
return (i) ? -1 : 0;
}