changeset 1520:d023247ae118

Fixed #62
author yoctozepto
date Wed, 04 Sep 2013 20:24:16 +0200
parents 4c787c28ddce
children 5c7316d3e038
files Party.cpp mm7_5.cpp
diffstat 2 files changed, 21 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/Party.cpp	Wed Sep 04 16:00:15 2013 +0200
+++ b/Party.cpp	Wed Sep 04 20:24:16 2013 +0200
@@ -1222,37 +1222,13 @@
 {
   if ( _506F18_num_minutes_to_sleep < 6 )
   {
-    pParty->pPlayers[3].SetAsleep(false);
-    pParty->pPlayers[2].SetAsleep(false);
-    pParty->pPlayers[1].SetAsleep(false);
-    pParty->pPlayers[0].SetAsleep(false);
     if ( _506F18_num_minutes_to_sleep )
     {
       Rest(_506F18_num_minutes_to_sleep);
       _506F18_num_minutes_to_sleep = 0;
       LoadActualSkyFrame();
     }
-    if ( dword_506F14 == 2 )
-    {
-      pGUIWindow_CurrentMenu->Release();
-      pEventTimer->Resume();
-      if ( pTexture_RestUI_CurrentSkyFrame )
-        pTexture_RestUI_CurrentSkyFrame->Release();
-      if ( pTexture_RestUI_CurrentHourglassFrame )
-        pTexture_RestUI_CurrentHourglassFrame->Release();
-      pTexture_RestUI_CurrentHourglassFrame = 0;
-      pTexture_RestUI_CurrentSkyFrame = 0;
-      pIcons_LOD->RemoveTexturesPackFromTextureList();
-      pIcons_LOD->SyncLoadedFilesCount();
-      pCurrentScreen = SCREEN_GAME;
-      viewparams->bRedrawGameUI = 1;
-      if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
-      {
-        pOutdoor->UpdateSunlightVectors();
-        pOutdoor->UpdateFog();
-      }
-    }
-    dword_506F14 = 0;
+    pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
   }
   else
   {
--- a/mm7_5.cpp	Wed Sep 04 16:00:15 2013 +0200
+++ b/mm7_5.cpp	Wed Sep 04 20:24:16 2013 +0200
@@ -1246,10 +1246,10 @@
                       if ( dword_506F14 )
                       {
                         Rest(_506F18_num_minutes_to_sleep);
-                        pParty->pPlayers[3].pConditions[2] = 0i64;
-                        pParty->pPlayers[2].pConditions[2] = 0i64;
-                        pParty->pPlayers[1].pConditions[2] = 0i64;
-                        pParty->pPlayers[0].pConditions[2] = 0i64;
+                        pParty->pPlayers[3].SetAsleep(false);
+                        pParty->pPlayers[2].SetAsleep(false);
+                        pParty->pPlayers[1].SetAsleep(false);
+                        pParty->pPlayers[0].SetAsleep(false);
                       }
                       pTexture_RestUI_CurrentSkyFrame->Release();
                       pTexture_RestUI_CurrentHourglassFrame->Release();
@@ -1257,6 +1257,11 @@
                       pTexture_RestUI_CurrentSkyFrame = 0;
                       pIcons_LOD->SyncLoadedFilesCount();
                       pIcons_LOD->RemoveTexturesPackFromTextureList();
+                      if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
+                      {
+                        pOutdoor->UpdateSunlightVectors();
+                        pOutdoor->UpdateFog();
+                      }
                       _506F18_num_minutes_to_sleep = 0;
                       dword_506F14 = 0;
                       dword_507B94 = 1;
@@ -1275,18 +1280,18 @@
                           unk_50C9A0 = 0;
                           back_to_game();
                          }
-                       }
-                       if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
+                      }
+                      if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
                         uActiveCharacter = pParty->GetNextActiveCharacter();
-                       pGUIWindow_CurrentMenu->Release();
-                       if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
-                       window_SpeakInHouse = 0;
-                       pGUIWindow_CurrentMenu = 0;
-                       pEventTimer->Resume();
-                       pCurrentScreen = SCREEN_GAME;
-                       viewparams->bRedrawGameUI = 1;
-                       pIcons_LOD->RemoveTexturesFromTextureList();
-                       continue;
+                      pGUIWindow_CurrentMenu->Release();
+                      if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
+                        window_SpeakInHouse = 0;
+                      pGUIWindow_CurrentMenu = 0;
+                      pEventTimer->Resume();
+                      pCurrentScreen = SCREEN_GAME;
+                      viewparams->bRedrawGameUI = 1;
+                      pIcons_LOD->RemoveTexturesFromTextureList();
+                      continue;
                     case SCREEN_E:
 						__debugbreak();
                       pGUIWindow_CurrentMenu->Release();