changeset 1071:a7e63532b9a8

pointer cleaning
author zipi
date Fri, 24 May 2013 20:57:11 +0100
parents 944e8d715a3e
children 48168499f52e 3dc32954f1c7
files Party.cpp Player.cpp SpriteObject.cpp
diffstat 3 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Party.cpp	Fri May 24 20:33:37 2013 +0100
+++ b/Party.cpp	Fri May 24 20:57:11 2013 +0100
@@ -332,7 +332,7 @@
   //unsigned __int8 v9; // zf@37
   //char v10; // sf@37
   //unsigned __int8 v11; // of@37
-  char *pAttributes; // eax@38
+  ItemGen *pItems; // eax@38
   signed int v13; // ecx@38
   int uMaxSP; // eax@42
   unsigned int v15; // [sp-4h] [bp-44h]@14
@@ -556,13 +556,13 @@
         //v10 = uSkillIdx - 35 < 0;
       }
       //while (uSkillIdx < 36);
-      pAttributes = (char *)&pCharacter->pInventoryItems[0].uAttributes;
+      pItems = pCharacter->pInventoryItems;
       //v13 = 138;
-      for (v13 = 138; v13 > 0; --v13)
+      for (int i = 0; i < 138; i++)
       {
-        if ( *((int *)pAttributes - 5) )
-          *(int *)pAttributes |= 1;
-        pAttributes += 36;
+		if ( pItems->uItemID )
+          pItems->uAttributes |= 1;
+        ++pItems;
         //--v13;
       }
       //while ( v13 );
--- a/Player.cpp	Fri May 24 20:33:37 2013 +0100
+++ b/Player.cpp	Fri May 24 20:57:11 2013 +0100
@@ -9536,8 +9536,9 @@
         case VAR_Dead:
         case VAR_Stoned:
         case VAR_Eradicated:
-          *((int *)this + 2 * VarNum - 210) = 0;
-          *((int *)this + 2 * result - 209) = 0;
+          //*((int *)this + 2 * VarNum - 210) = 0;
+		  //*((int *)this + 2 * result - 209) = 0;
+		  this->pConditions[VarNum] = 0;
           pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
           v8 = 8 * v4 + 400;
           LOBYTE(v8) = PID(OBJECT_Player,v4 - 112);
--- a/SpriteObject.cpp	Fri May 24 20:33:37 2013 +0100
+++ b/SpriteObject.cpp	Fri May 24 20:57:11 2013 +0100
@@ -725,7 +725,7 @@
               //if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) )
 				if( pActors[pSpriteObject->spell_caster_pid >> 3].pMonsterInfo.uID != v39b->pMonsterInfo.uID )
 					//not sure: pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius
-					_46DF1A_collide_against_actor(v42, *((short *)&pMonsterList->pMonsters[v39b->word_000086_some_monster_id] - 73));
+					_46DF1A_collide_against_actor(v42, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius);
               ++v42;
               ++v39b;// += 836;
             }
@@ -740,7 +740,7 @@
             v39b = pActors;//[0].word_000086_some_monster_id;
             do
             {
-              _46DF1A_collide_against_actor(v42++, *((short *)&pMonsterList->pMonsters[v39b->word_000086_some_monster_id] - 73));
+				_46DF1A_collide_against_actor(v42++, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius);
               ++v39b;
             }
             while ( v42 < (signed int)uNumActors );