Advertisement
MageKing17

mainhallmenu.cpp.patch

Apr 10th, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.86 KB | None | 0 0
  1. Index: code/menuui/mainhallmenu.cpp
  2. ===================================================================
  3. --- code/menuui/mainhallmenu.cpp    (revision 11307)
  4. +++ code/menuui/mainhallmenu.cpp    (working copy)
  5. @@ -59,8 +59,10 @@
  6.  
  7.  SCP_vector< SCP_vector<main_hall_defines> > Main_hall_defines;
  8.  
  9. -main_hall_defines *Main_hall = NULL;
  10. +static main_hall_defines *Main_hall = NULL;
  11.  
  12. +static int Main_hall_music_index = -1;
  13. +
  14.  int Vasudan_funny = 0;
  15.  int Vasudan_funny_plate = -1;
  16.  
  17. @@ -439,7 +441,7 @@
  18.     }
  19.  
  20.     // if we're switching to a different mainhall we may need to change music
  21. -   if (main_hall_get_music_index(main_hall_get_index(main_hall_to_load)) != main_hall_get_music_index(main_hall_id())) {
  22. +   if (main_hall_get_music_index(main_hall_get_index(main_hall_to_load)) != Main_hall_music_index) {
  23.         main_hall_stop_music(true);
  24.     }
  25.  
  26. @@ -447,8 +449,8 @@
  27.     snazzy_menu_init();
  28.    
  29.     // assign the proper main hall data
  30. -   Assert(main_hall_get_pointer(main_hall_to_load) != NULL);
  31.     Main_hall = main_hall_get_pointer(main_hall_to_load);
  32. +   Assertion(Main_hall != NULL, "Failed to obtain pointer to main hall '%s'; get a coder!\n", main_hall_to_load.c_str());
  33.  
  34.     // check if we have to change the ready room's description
  35.     if(Main_hall->default_readyroom) {
  36. @@ -1138,7 +1140,6 @@
  37.   */
  38.  void main_hall_start_music()
  39.  {
  40. -   int index;
  41.     char *filename;
  42.  
  43.     // start a looping ambient sound
  44. @@ -1155,13 +1156,13 @@
  45.     }
  46.  
  47.     // get music
  48. -   index = main_hall_get_music_index(main_hall_id());
  49. -   if (index < 0) {
  50. +   Main_hall_music_index = main_hall_get_music_index(main_hall_id());
  51. +   if (Main_hall_music_index < 0) {
  52.         nprintf(("Warning", "No music file exists to play music at the main menu!\n"));
  53.         return;
  54.     }
  55.  
  56. -   filename = Spooled_music[index].filename;
  57. +   filename = Spooled_music[Main_hall_music_index].filename;
  58.     Assert(filename != NULL);
  59.  
  60.     // get handle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement