void AddLump( FILE *file, bspHeader_t *header, int lumpNum, const void *data, int length ){
bspLump_t *lump;
-
/* add lump to bsp file header */
lump = &header->lumps[ lumpNum ];
lump->offset = LittleLong( ftell( file ) );
lump->length = LittleLong( length );
/* write lump to file */
- SafeWrite( file, data, ( length + 3 ) & ~3 );
+ SafeWrite( file, data, length );
+
+ /* write padding zeros */
+ char *zeros[3] = { 0, 0, 0 };
+ SafeWrite( file, zeros, ( ( length + 3 ) & ~3 ) - length );
}