diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 23b38f7b2..c92007da4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D2X-Rebirth Changelog +20101204 +-------- +main/bmread.c, main/piggy.c: Set a bogus sound when a sound is skipped in gamedata_read_tbl and don't let piggy_close free it + 20101203 -------- main/net_udp.c: Made resent_delay for net_udp_noloss_process_queue() a bit longer depending on the player's ping diff --git a/main/bmread.c b/main/bmread.c index cc2ecf472..30de4167a 100644 --- a/main/bmread.c +++ b/main/bmread.c @@ -292,7 +292,9 @@ int ds_load(int skip, char * filename ) { char rawname[100]; if (skip) { - return 0; //don't know what I should return here //&bogus_sound; + // We tell piggy_register_sound it's in the pig file, when in actual fact it's in no file + // This just tells piggy_close not to attempt to free it + return piggy_register_sound( &bogus_sound, "bogus", 1 ); } removeext(filename, fname); diff --git a/main/piggy.c b/main/piggy.c index 064c89744..39a1e70be 100644 --- a/main/piggy.c +++ b/main/piggy.c @@ -229,6 +229,8 @@ bitmap_index piggy_register_bitmap( grs_bitmap * bmp, char * name, int in_file ) if ( !GameArg.DbgBigPig ) gr_bitmap_rle_compress( bmp ); Num_bitmap_files_new++; } + else if (SoundOffset[Num_sound_files] == 0) + SoundOffset[Num_sound_files] = -1; // make sure this sound's data is not individually freed strncpy( AllBitmaps[Num_bitmap_files].name, name, 12 ); hashtable_insert( &AllBitmapsNames, AllBitmaps[Num_bitmap_files].name, Num_bitmap_files );