changeset 305:cc8e4dc397ec

MonsterPopup_Draw crash fix
author Nomad
date Tue, 19 Feb 2013 21:50:33 +0200
parents f16ac5e65438
children e33f5a1cdc46
files Actor.cpp Indoor.cpp Items.h mm7_1.cpp mm7_3.cpp mm7_5.cpp mm7_6.cpp
diffstat 7 files changed, 18 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Tue Feb 19 15:40:11 2013 +0200
+++ b/Actor.cpp	Tue Feb 19 21:50:33 2013 +0200
@@ -3216,7 +3216,7 @@
   v3 = 60 * v1->pSpriteIDs[5];
   v1->uCurrentActionTime = 0;
   v1->uAIState = Dying;
-  v1->uCurrentActionAnimation = 5;
+  v1->uCurrentActionAnimation = ANIM_Dying;
   LOWORD(v3) = *(__int16 *)((char *)&v2->uAnimLength + v3);
   v1->sCurrentHP = 0;
   v1->uCurrentActionLength = 8 * v3;
@@ -4168,7 +4168,7 @@
   this->uActorRadius = 32;
   this->uActorHeight = 128;
   this->uAIState = Standing;
-  this->uCurrentActionAnimation = 0;
+  this->uCurrentActionAnimation = ANIM_Standing;
   this->uMovementSpeed = 200;
   this->uCarriedItemID = 0;
   this->uGroup = 0;
--- a/Indoor.cpp	Tue Feb 19 15:40:11 2013 +0200
+++ b/Indoor.cpp	Tue Feb 19 21:50:33 2013 +0200
@@ -4004,7 +4004,7 @@
           || (v56 = _46CEC3_get_floor_level(v0->vPosition.x, v0->vPosition.y, v0->vPosition.z, v5, &uFaceID), v56 == -30000) )
           goto LABEL_123;
       }
-      if ( v0->uCurrentActionAnimation == 1 )
+      if ( v0->uCurrentActionAnimation == ANIM_Walking)
       {
         v6 = v0->uMovementSpeed;
         v7 = HIDWORD(v0->pActorBuffs[7].uExpireTime) == 0;
--- a/Items.h	Tue Feb 19 15:40:11 2013 +0200
+++ b/Items.h	Tue Feb 19 21:50:33 2013 +0200
@@ -56,6 +56,7 @@
   ITEM_SPELLBOOK_LIGHT_SUN_BURST = 0x1E6,
   ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION = 0x1E7,
   ITEM_ARTIFACT_PUCK = 0x1F4,
+  ITEM_ARTIFACT_SPLITTER = 506,//1FA
   ITEM_RELIC_MEKORIGS_HAMMER = 0x210,
 };
 
--- a/mm7_1.cpp	Tue Feb 19 15:40:11 2013 +0200
+++ b/mm7_1.cpp	Tue Feb 19 21:50:33 2013 +0200
@@ -2924,7 +2924,7 @@
   else
   {
     memcpy(&pMonsterInfoUI_Doll, v3, sizeof(pMonsterInfoUI_Doll));
-    pMonsterInfoUI_Doll.uCurrentActionAnimation = 7;
+    pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored;
     pMonsterInfoUI_Doll.uCurrentActionTime = 0;
     v8 = rand();
     v3 = v121;
@@ -2934,27 +2934,24 @@
   if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 )
   {
     pMonsterInfoUI_Doll.uCurrentActionTime = 0;
-    if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == 7 || pMonsterInfoUI_Doll.uCurrentActionAnimation == 2 )
-    {
-      pMonsterInfoUI_Doll.uCurrentActionAnimation = 0;
+    if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee)
+    {
+      pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing;
       pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128;
     }
     else
     {
       rand();
-      pMonsterInfoUI_Doll.uCurrentActionAnimation = 7;
+      pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored;
       if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186)
         && (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249)
         && rand() % 30 < 100 )
-        pMonsterInfoUI_Doll.uCurrentActionAnimation = 2;
-      pMonsterInfoUI_Doll.uCurrentActionLength = 8
-                                               * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength;
-    }
-  }
-  v10 = pSpriteFrameTable->GetFrame(
-          v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation],
-          pMonsterInfoUI_Doll.uCurrentActionTime);
-  v11 = pSprites_LOD[v10->pHwSpriteIDs[0]].pSpriteHeaders;//40 * v10->pHwSpriteIDs[0] + 7218180;
+        pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee;
+      pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength;
+    }
+  }
+  v10 = pSpriteFrameTable->GetFrame( v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime);
+  v11 = &pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]];//40 * v10->pHwSpriteIDs[0] + 7218180;
   v106.pTarget = pRenderer->pTargetSurface;
   v106.pTargetZ = pRenderer->pActiveZBuffer;
   v106.uTargetPitch = pRenderer->uTargetSurfacePitch;
--- a/mm7_3.cpp	Tue Feb 19 15:40:11 2013 +0200
+++ b/mm7_3.cpp	Tue Feb 19 21:50:33 2013 +0200
@@ -1017,7 +1017,7 @@
       v0->uAIState = Removed;
       goto LABEL_121;
     }
-    if ( v0->uCurrentActionAnimation == 1 )
+    if ( v0->uCurrentActionAnimation == ANIM_Walking )
     {
       v8 = v0->uMovementSpeed;
       v9 = HIDWORD(v0->pActorBuffs[7].uExpireTime) == 0;
--- a/mm7_5.cpp	Tue Feb 19 15:40:11 2013 +0200
+++ b/mm7_5.cpp	Tue Feb 19 21:50:33 2013 +0200
@@ -2280,7 +2280,7 @@
             }
             if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
             {
-              pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+              pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
               *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
               ++pMessageQueue_50CBD0->uNumMessages;
--- a/mm7_6.cpp	Tue Feb 19 15:40:11 2013 +0200
+++ b/mm7_6.cpp	Tue Feb 19 21:50:33 2013 +0200
@@ -7970,7 +7970,7 @@
     Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z);
 
     DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3);
-    if (player->WearsItem(506, 1) || player->WearsItem(506, 0))
+    if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0))
           _42FA66_do_explosive_impact(
             actor->vPosition.x,
             actor->vPosition.y,