changeset 2225:080fd5a5433d

Merge
author Grumpy7
date Wed, 19 Feb 2014 22:30:39 +0100
parents c2eeeb991a87 (diff) 17bc3a1eb037 (current diff)
children 5944810e88e2 10c909eb6766
files CastSpellInfo.cpp Game.cpp Indoor.cpp Player.cpp UI/UiGame.cpp
diffstat 6 files changed, 24 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/CastSpellInfo.cpp	Wed Feb 19 13:01:36 2014 +0600
+++ b/CastSpellInfo.cpp	Wed Feb 19 22:30:39 2014 +0100
@@ -492,7 +492,7 @@
         pSpellSprite.uAttributes |= 0x80u;
         pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
         int obj_id = pSpellSprite.Create(0, 0, 0, 0);
-        if ( !MonsterStats::BelongsToSupertype(pActor->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
+        if ( !MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
         {
           ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
           pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
@@ -2070,8 +2070,8 @@
         if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Eradicated]
           || pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Dead] )
         {
-          if ( !(pParty->pPlayers[v396].pConditions[Condition_Weak]) )
-            pParty->pPlayers[v396].PlaySound(SPEECH_25, 0);
+          if ( !(pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Weak]) )
+            pParty->pPlayers[pCastSpell->uPlayerID_2].PlaySound(SPEECH_25, 0);
           if ( skill_level == 4 )
           {
             pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Eradicated] = 0;
--- a/Game.cpp	Wed Feb 19 13:01:36 2014 +0600
+++ b/Game.cpp	Wed Feb 19 22:30:39 2014 +0100
@@ -1312,6 +1312,7 @@
   char Str2[128]; // [sp+238h] [bp-3C4h]@527
   Actor actor; // [sp+2B8h] [bp-344h]@4
   //unsigned short* screenshot;
+  int currHour;
 
   dword_50CDC8 = 0;
   if ( !pEventTimer->bPaused )
@@ -1904,8 +1905,8 @@
             uVoicesVolumeMultiplier = 9;
           if ( !uVoicesVolumeMultiplier )
             continue;
-            pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
-            continue;
+          pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
+          continue;
         case UIMSG_SetTurnSpeed:
           if ( uMessageParam )
             pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam;
@@ -4008,19 +4009,22 @@
           GameUI_SetFooterString(pTmpBuf.data());
           continue;
         case UIMSG_ShowStatus_DateTime:
-          pNPCData4 = (NPCData *)pParty->uCurrentHour;
-          if ( (signed int)pParty->uCurrentHour <= 12 )
+          currHour = pParty->uCurrentHour;
+          uNumSeconds = 1;
+          if (pParty->uCurrentHour > 12 )
           {
-            if ( !pNPCData4 )
-              pNPCData4 = (NPCData *)12;
+            if (pParty->uCurrentHour >= 24)
+              uNumSeconds = 0;
+            currHour = (currHour - 12);
           }
-          else
+          else 
           {
-            pNPCData4 = (NPCData *)((char *)pNPCData4 - 12);
+		  	if (pParty->uCurrentHour < 12) // 12:00 is PM
+	            uNumSeconds = 0;
+            if (pParty->uCurrentHour == 0)
+              currHour = 12;
           }
-          if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) )
-            uNumSeconds = 0;
-          sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7],
+          sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", currHour, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7],
             7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear);
           GameUI_SetFooterString(pTmpBuf.data());
           continue;
--- a/Indoor.cpp	Wed Feb 19 13:01:36 2014 +0600
+++ b/Indoor.cpp	Wed Feb 19 22:30:39 2014 +0100
@@ -3230,7 +3230,7 @@
 
   for (uint i = 0; i < pIndoor->uNumFaces; ++i)
   {
-    if (!pIndoor->pFaces[i].uBitmapID != -1)
+    if (pIndoor->pFaces[i].uBitmapID != -1)
       pBitmaps_LOD->pTextures[pIndoor->pFaces[i].uBitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[pIndoor->pFaces[i].uBitmapID].palette_id1);
   }
 
--- a/Player.cpp	Wed Feb 19 13:01:36 2014 +0600
+++ b/Player.cpp	Wed Feb 19 22:30:39 2014 +0100
@@ -1996,8 +1996,7 @@
   {
     return 0;
   }
-  //pGlobalTXT_LocalizationStrings[1];//Accuracy
-  if ( !(actroPtr->uAttributes & 0x800000) )
+  if ( !(BYTE2(actroPtr->uAttributes) & 0x80) )
     actroPtr->SetRandomGoldIfTheresNoItem();
   unsigned __int16 v6 = this->pActiveSkills[PLAYER_SKILL_STEALING];
   v7 = v6 & 0x3F;
@@ -2006,8 +2005,7 @@
   int v29 = StealingRandomBonuses[rand() % 5];
   fineIfFailed = actroPtr->pMonsterInfo.uLevel + 100 * (_steal_perm + reputation);
   currMaxItemValue = v29 + v7 * v30;
-  //pGlobalTXT_LocalizationStrings[200];//Sell
-  if ( rand() % 100 < 5 || fineIfFailed > currMaxItemValue || actroPtr->uAttributes & 0x80000 )
+  if ( rand() % 100 < 5 || fineIfFailed > currMaxItemValue || BYTE2(actroPtr->uAttributes) & 8 )
   {
     Actor::AggroSurroundingPeasants(uActorID, 1);
     sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[376], this->pName);//"%s was caught stealing!"
--- a/SaveLoad.cpp	Wed Feb 19 13:01:36 2014 +0600
+++ b/SaveLoad.cpp	Wed Feb 19 22:30:39 2014 +0100
@@ -470,7 +470,7 @@
     compressed_block_size += 16;
     memcpy(&((ODMHeader *)compressed_buf)->uCompressedSize, &compressed_block_size, 4);
     memcpy(&((ODMHeader *)compressed_buf)->uDecompressedSize, &Size, 4);
-    sprintf(Source, "%s%s", &Filename, &Ext);
+    sprintf(Source, "%s%s", Filename, Ext);
     strcpy(pLodDirectory.pFilename, Source);
     pLodDirectory.uDataSize = compressed_block_size;
     if ( pNew_LOD->Write(&pLodDirectory, (const void *)compressed_buf, 0) )
--- a/UI/UiGame.cpp	Wed Feb 19 13:01:36 2014 +0600
+++ b/UI/UiGame.cpp	Wed Feb 19 22:30:39 2014 +0100
@@ -118,8 +118,10 @@
     return;
   viewparams->bRedrawGameUI = true;
   if ( uActiveCharacter != uPlayerID )
+  {
     uActiveCharacter = uPlayerID;
     return;
+  }
   if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6)
   {
     __debugbreak(); // fix indexing