changeset 1982:2647e2f820a6

Слияние
author Ritor1
date Fri, 01 Nov 2013 14:44:06 +0600
parents d9ea00250e2e (current diff) c1c74df0a33e (diff)
children 5cd26f2c6904
files Render.cpp
diffstat 52 files changed, 851 insertions(+), 916 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Actor.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -33,6 +33,7 @@
 #include "Log.h"
 #include "Texts.h"
 #include "Level/Decoration.h"
+#include "Viewport.h"
 
 
 
@@ -154,8 +155,8 @@
   bool isstoned; // edi@2
   AIState v3; // ax@6
 
-  isstoned = (signed __int64)this->pActorBuffs[5].uExpireTime > 0;// stoned
-  isparalyzed = (signed __int64)this->pActorBuffs[6].uExpireTime > 0;// paralyzed
+  isstoned = (signed __int64)this->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime > 0;// stoned
+  isparalyzed = (signed __int64)this->pActorBuffs[ACTOR_BUFF_PARALYZED].uExpireTime > 0;// paralyzed
   v3 = this->uAIState;
   return !(isstoned || isparalyzed || v3 == Dying || v3 == Dead || v3 == Removed || v3 == Summoned || v3 == Disabled);
 }
@@ -165,7 +166,7 @@
 {
   bool isstoned; // esi@1
 
-  isstoned = (signed __int64)this->pActorBuffs[5].uExpireTime > 0;// stoned
+  isstoned = (signed __int64)this->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime > 0;// stoned
   return (isstoned || (uAIState == Dying) || (uAIState == Dead) || (uAIState == Removed) || (uAIState == Summoned) || (uAIState == Disabled));
 }
 
@@ -321,7 +322,7 @@
         v39 = 240 * (realPoints + 15);
       else
         v39 = 0;
-      actorPtr->pActorBuffs[19].Apply(
+      actorPtr->pActorBuffs[ACTOR_BUFF_HASTE].Apply(
         pParty->uTimePlayed + (signed int)(signed __int64)((double)(v39 << 7) * 0.033333335),
         masteryLevel,
         0,
@@ -468,7 +469,7 @@
         v8 = 3600 * (realPoints + 64);
       else
         v8 = 0;
-      actorPtr->pActorBuffs[15].Apply(
+      actorPtr->pActorBuffs[ACTOR_BUFF_SHIELD].Apply(
         pParty->uTimePlayed + (signed int)(signed __int64)((double)(v8 << 7) * 0.033333335),
         masteryLevel,
         0,
@@ -485,7 +486,7 @@
         v44 = 3600 * (realPoints + 64);
       else
           v44 = 0;
-      actorPtr->pActorBuffs[16].Apply(
+      actorPtr->pActorBuffs[ACTOR_BUFF_STONESKIN].Apply(
         pParty->uTimePlayed + (signed int)(signed __int64)((double)(v44 << 7) * 0.033333335),
         masteryLevel,
         realPoints + 5,
@@ -504,7 +505,7 @@
         v42 = 1200 * realPoints + 3840;
       else
         v42 = 0;
-      actorPtr->pActorBuffs[17].Apply(
+      actorPtr->pActorBuffs[ACTOR_BUFF_BLESS].Apply(
         pParty->uTimePlayed + (signed int)(signed __int64)((double)(v42 << 7) * 0.033333335),
         masteryLevel,
         realPoints + 5,
@@ -524,7 +525,7 @@
         v48 = 2 * (3 * realPoints + 60);
       else
         v48 = 0;
-      actorPtr->pActorBuffs[11].Apply(pParty->uTimePlayed + 1280, masteryLevel, v48, 0, 0);
+      actorPtr->pActorBuffs[ACTOR_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, masteryLevel, v48, 0, 0);
       pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(actorPtr,0xC8C805u);
       pAudioPlayer->PlaySound((SoundID)14020, PID(OBJECT_Actor, uActorID), 0, -1, 0, 0, 0, 0);
       return;
@@ -538,7 +539,7 @@
         v54 = 1200 * realPoints + 3840;
       else
         v54 = 0;
-      actorPtr->pActorBuffs[18].Apply(
+      actorPtr->pActorBuffs[ACTOR_BUFF_HEROISM].Apply(
         pParty->uTimePlayed + (signed int)(signed __int64)((double)(v54 << 7) * 0.033333335),
         masteryLevel,
         realPoints + 5,
@@ -553,7 +554,7 @@
         v51 = 0;
       else
         v51 = 3600 * realPoints;
-      actorPtr->pActorBuffs[21].Apply(
+      actorPtr->pActorBuffs[ACTOR_BUFF_PAIN_HAMMERHANDS].Apply(
         pParty->uTimePlayed + (signed int)(signed __int64)((double)(v51 << 7) * 0.033333335),
         masteryLevel,
         realPoints,
@@ -617,7 +618,7 @@
         LOWORD(realPoints) = uSkillLevel;
         v96 = 0;
       }
-      actorPtr->pActorBuffs[13].Apply(
+      actorPtr->pActorBuffs[ACTOR_BUFF_DAY_OF_PROTECTION].Apply(
         pParty->uTimePlayed + (signed int)(signed __int64)((double)(v96 << 7) * 0.033333335),
         masteryLevel,
         realPoints,
@@ -636,7 +637,7 @@
         v94 = 1200 * realPoints + 3840;
       else
         v94 = 0;
-      actorPtr->pActorBuffs[14].Apply(
+      actorPtr->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].Apply(
         pParty->uTimePlayed + (signed int)(signed __int64)((double)(v94 << 7) * 0.033333335),
         masteryLevel,
         realPoints + 5,
@@ -710,7 +711,7 @@
         v68 = 300 * realPoints + 3840;
       else
         v68 = 900 * realPoints + 3840;
-      actorPtr->pActorBuffs[20].Apply(
+      actorPtr->pActorBuffs[ACTOR_BUFF_PAIN_REFLECTION].Apply(
         pParty->uTimePlayed + (signed int)(signed __int64)((double)(v68 << 7) * 0.033333335),
         masteryLevel,
         0,
@@ -1197,7 +1198,7 @@
 void Actor::AI_Stand(unsigned int uActorID, unsigned int object_to_face_pid, unsigned int uActionLength, AIDirection *a4)
 {
   assert(uActorID < uNumActors);
-  auto actor = &pActors[uActorID];
+  Actor* actor = &pActors[uActorID];
   
   AIDirection a3;
   if (!a4)
@@ -1292,7 +1293,7 @@
     v3->uAIState = AttackingMelee;
     Actor::PlaySound(uActorID, 0);
     v25 = pMonsterStats->pInfos[v3->pMonsterInfo.uID].uRecoveryTime;
-    if ( v3->pActorBuffs[7].uExpireTime > 0 )
+    if ( v3->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime > 0 )
     {
       v25 *= 2;
     }
@@ -1427,12 +1428,12 @@
   switch( dmgSource )
   {
     case 0: 
-      if ( this->pActorBuffs[14].uExpireTime > 0 )
-        v2 = this->pActorBuffs[14].uPower;
-      if ( this->pActorBuffs[18].uExpireTime > 0 && this->pActorBuffs[18].uPower > v2 )
-        v2 = this->pActorBuffs[18].uPower;
-      if ( this->pActorBuffs[21].uExpireTime > 0 )
-        v2 += this->pActorBuffs[21].uPower;
+      if ( this->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 )
+        v2 = this->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower;
+      if ( this->pActorBuffs[ACTOR_BUFF_HEROISM].uExpireTime > 0 && this->pActorBuffs[ACTOR_BUFF_HEROISM].uPower > v2 )
+        v2 = this->pActorBuffs[ACTOR_BUFF_HEROISM].uPower;
+      if ( this->pActorBuffs[ACTOR_BUFF_PAIN_HAMMERHANDS].uExpireTime > 0 )
+        v2 += this->pActorBuffs[ACTOR_BUFF_PAIN_HAMMERHANDS].uPower;
       v3 = this->pMonsterInfo.uAttack1DamageDiceRolls;
       v4 = this->pMonsterInfo.uAttack1DamageDiceSides;
       v5 = this->pMonsterInfo.uAttack1DamageBonus;
@@ -1572,7 +1573,7 @@
     v3->uAIState = AttackingRanged4;
     Actor::PlaySound(uActorID, 0);
     pDira = pMonsterStats->pInfos[v3->pMonsterInfo.uID].uRecoveryTime;
-    if (v3->pActorBuffs[7].uExpireTime > 0)
+    if (v3->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime > 0)
     {
       pDira *= 2;
     }
@@ -1656,7 +1657,7 @@
     v3->uAIState = AttackingRanged3;
     Actor::PlaySound(uActorID, 0);
     pDira = pMonsterStats->pInfos[v3->pMonsterInfo.uID].uRecoveryTime;
-    if (v3->pActorBuffs[7].uExpireTime > 0)
+    if (v3->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime > 0)
     {
       pDira *= 2;
     }
@@ -1740,7 +1741,7 @@
     v3->uAIState = AttackingRanged2;
     Actor::PlaySound(uActorID, 0);
     pDira = pMonsterStats->pInfos[v3->pMonsterInfo.uID].uRecoveryTime;
-    if ( v3->pActorBuffs[7].uExpireTime > 0 )
+    if ( v3->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime > 0 )
     {
       pDira *= 2;
     }
@@ -1821,7 +1822,7 @@
     v3->uAIState = AttackingRanged1;
     Actor::PlaySound(uActorID, 0);
     pDira = pMonsterStats->pInfos[v3->pMonsterInfo.uID].uRecoveryTime;
-    if ( v3->pActorBuffs[7].uExpireTime > 0 )
+    if ( v3->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime > 0 )
     {
       pDira *= 2;
     }
@@ -1973,10 +1974,10 @@
     v4->uAttributes &= 0xFFFFFFFBu;
     v4->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
   }
-  if ( v4->pActorBuffs[1].uExpireTime > 0 )
-    v4->pActorBuffs[1].Reset();
-  if ( v4->pActorBuffs[4].uExpireTime > 0 )
-    v4->pActorBuffs[4].Reset();
+  if ( v4->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 )
+    v4->pActorBuffs[ACTOR_BUFF_CHARM].Reset();
+  if ( v4->pActorBuffs[ACTOR_BUFF_AFRAID].uExpireTime > 0 )
+    v4->pActorBuffs[ACTOR_BUFF_AFRAID].Reset();
   if ( stunRegardlessOfState
     || (v4->uAIState != Stunned
     && v4->uAIState != AttackingRanged1
@@ -2051,15 +2052,15 @@
 //----- (00402D6E) --------------------------------------------------------
 void Actor::Die(unsigned int uActorID)
 {
-  auto actor = &pActors[uActorID];
+  Actor* actor = &pActors[uActorID];
 
   actor->uCurrentActionTime = 0;
   actor->uAIState = Dying;
   actor->uCurrentActionAnimation = ANIM_Dying;
   actor->sCurrentHP = 0;
   actor->uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[actor->pSpriteIDs[ANIM_Dying]].uAnimLength;
-  actor->pActorBuffs[6].Reset();
-  actor->pActorBuffs[5].Reset();
+  actor->pActorBuffs[ACTOR_BUFF_PARALYZED].Reset();
+  actor->pActorBuffs[ACTOR_BUFF_STONED].Reset();
   Actor::PlaySound(uActorID, 1);
   actor->UpdateAnimation();
 
@@ -2120,13 +2121,13 @@
   v3 = pActors[uActorID].pSoundSampleIDs[uSoundID];
   if ( v3 )
   {
-    if ( pActors[uActorID].pActorBuffs[3].uExpireTime <= 0 )
+    if ( pActors[uActorID].pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime <= 0 )
     {
       pAudioPlayer->PlaySound((SoundID)v3, PID(OBJECT_Actor, uActorID), 0, -1, 0, 0, 0, 0);
     }
     else
     {
-      switch(pActors[uActorID].pActorBuffs[3].uPower)
+      switch(pActors[uActorID].pActorBuffs[ACTOR_BUFF_SHRINK].uPower)
       {
         case 1: 
           pAudioPlayer->PlaySound((SoundID)v3, PID(OBJECT_Actor, uActorID), 0, 0, 0, 0, 0, 33075);
@@ -2466,9 +2467,9 @@
   if (can_target_party && !pParty->Invisible())
   {
     if ( thisActor->uAttributes & 0x80000
-      && thisActor->pActorBuffs[12].uExpireTime <= 0
-      && thisActor->pActorBuffs[1].uExpireTime <= 0
-      && thisActor->pActorBuffs[2].uExpireTime <= 0 )
+      && thisActor->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime <= 0
+      && thisActor->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime <= 0
+      && thisActor->pActorBuffs[ACTOR_BUFF_SUMMONED].uExpireTime <= 0 )
       v14 = 4;
     else
       v14 = thisActor->GetActorsRelation(0);
@@ -2956,7 +2957,7 @@
 				{
 					pPlayer = pPlayers[i];
 					if ( !pPlayer->pConditions[Condition_Dead] && !pPlayer->pConditions[Condition_Pertified] && !pPlayer->pConditions[Condition_Eradicated] )
-						pPlayer->ReceiveDamage(v4, DMGT_5);
+						pPlayer->ReceiveDamage(v4, DMGT_MAGICAL);
 				}
 			}
 			if (pTurnEngine->pending_actions)
@@ -3060,13 +3061,13 @@
 		// not sure
 		else if ( pActor->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime < 0 )
 			pActor->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].uHostilityType;
-		if ( pActor->pActorBuffs[2].uExpireTime < 0 )
+		if ( pActor->pActorBuffs[ACTOR_BUFF_SUMMONED].uExpireTime < 0 )
 		{
 			pActor->uAIState = Removed;
 			continue;
 		}
-		if ( (signed __int64)pActor->pActorBuffs[5].uExpireTime > 0
-			|| (signed __int64)pActor->pActorBuffs[6].uExpireTime > 0)
+		if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime > 0
+			|| (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_PARALYZED].uExpireTime > 0)
 		{
 			continue;
 		}
@@ -3095,7 +3096,7 @@
 			}
 			else if ( pActor->uAIState == AttackingMelee )
 			{
-				v35 = stru_50C198.special_ability_use_check(pActor, actor_id);
+				v35 = pActor->special_ability_use_check(actor_id);
 				stru_50FE08.Add(
 					a1,
 					5120,
@@ -3159,7 +3160,7 @@
 				pActor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
 		}
 
-		if (pActor->pActorBuffs[4].uExpireTime > 0)
+		if (pActor->pActorBuffs[ACTOR_BUFF_AFRAID].uExpireTime > 0)
 		{
 			if ( (signed int)v36 >= 10240 )
 			{
@@ -3216,7 +3217,7 @@
 			pActor->uAttributes &= 0xFFFBFFFF;
 			if ( v81 < 5120 )
 			{
-				v45 = stru_50C198.special_ability_use_check(pActor, actor_id);
+				v45 = pActor->special_ability_use_check(actor_id);
 				if ( v45 == 0 )
 				{
 					if ( pActor->pMonsterInfo.uMissleAttack1Type )
@@ -3544,7 +3545,7 @@
   Log::Warning(L"%S %S %u", __FILE__, __FUNCTION__, __LINE__); // ai_near_actors_targets_pid[i] for AI_Stand seems always 0;  original code behaviour is identical
   for (uint i = 0; i < uNumActors; ++i)
   {
-    auto actor = &pActors[i];
+    Actor* actor = &pActors[i];
 
     if (actor->CanAct() || actor->uAIState == Disabled)
     {
@@ -3829,7 +3830,7 @@
     {
       if ( pRenderer->pRenderD3D && pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS )
       {
-        v33 = byte_4D864C && pGame->uFlags & 80000 ? 10 * pMonster->uActorRadius : pMonster->uActorRadius;
+        v33 = byte_4D864C && pGame->uFlags & 0x80000 ? 10 * pMonster->uActorRadius : pMonster->uActorRadius;
         pDecalBuilder->AddBloodsplat((float)pMonster->vPosition.x, (float)pMonster->vPosition.y, (float)pMonster->vPosition.z, 1.0, 0.0, 0.0, (float)v33, 0, 0);
       }
     }
@@ -4116,3 +4117,291 @@
   }
   return false;
 }
+
+
+//----- (00426A5A) --------------------------------------------------------
+void Actor::LootActor()
+{
+  signed int v2; // edi@1
+  unsigned __int8 v7; // al@30
+  char *v9; // [sp-4h] [bp-3Ch]@10
+  char *v10; // [sp-4h] [bp-3Ch]@31
+  char *v11; // [sp-4h] [bp-3Ch]@38
+  ItemGen Dst; // [sp+Ch] [bp-2Ch]@1
+  bool itemFound; // [sp+30h] [bp-8h]@1
+  int v14; // [sp+34h] [bp-4h]@1
+
+  pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
+  Dst.Reset();
+  v2 = 0;
+  itemFound = false;
+  v14 = 0;
+  if ( !( this->uAttributes & 0x800000 ) )
+  {
+    for (uchar i = 0; i < this->pMonsterInfo.uTreasureDiceRolls; i++ )
+    {
+        v14 += rand() % this->pMonsterInfo.uTreasureDiceSides + 1;
+      }
+    if ( v14 != 0 )
+      {
+        pParty->PartyFindsGold(v14, 0);
+        viewparams->bRedrawGameUI = 1;
+      }
+    }
+  else
+  {
+    if ( this->array_000234[3].uItemID != 0 &&  this->array_000234[3].GetItemEquipType() == EQUIP_GOLD )
+    {
+      v14 = this->array_000234[3].uSpecEnchantmentType;
+      this->array_000234[3].Reset();
+      if ( v14 )
+      {
+        pParty->PartyFindsGold(v14, 0);
+        viewparams->bRedrawGameUI = 1;
+      }
+    }
+  }
+  if ( this->uCarriedItemID )
+  {
+    Dst.Reset();
+    Dst.uItemID = this->uCarriedItemID;
+    v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
+    if ( v14 )
+      sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v9);
+    else
+      sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v9);
+    ShowStatusBarString(pTmpBuf2.data(), 2u);
+    if ( Dst.GetItemEquipType() == 12 )
+    {
+      Dst.uNumCharges = rand() % 6 + Dst.GetDamageMod() + 1;
+      Dst.uMaxCharges = Dst.uNumCharges;
+    }
+    if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 14 && Dst.uItemID != 220 )
+      Dst.uEnchantmentType = 2 * rand() % 4 + 2;
+    pItemsTable->SetSpecialBonus(&Dst);
+    if ( !pParty->AddItemToParty(&Dst) )
+      pParty->SetHoldingItem(&Dst);
+    this->uCarriedItemID = 0;
+    if ( this->array_000234[0].uItemID )
+    {
+      if ( !pParty->AddItemToParty(this->array_000234) )
+      {
+        pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
+        pParty->SetHoldingItem(this->array_000234);
+      }
+      this->array_000234[0].Reset();
+    }
+    if ( this->array_000234[1].uItemID )
+    {
+      if ( !pParty->AddItemToParty(&this->array_000234[1]) )
+      {
+        pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
+        pParty->SetHoldingItem(&this->array_000234[1]);
+      }
+      this->array_000234[1].Reset();
+    }
+    this->Remove();
+    return;
+  }
+  if ( ( this->uAttributes & 0x800000 ) )
+  {
+    if ( this->array_000234[3].uItemID )
+    {
+      memcpy(&Dst, &this->array_000234[3], sizeof(Dst));
+      this->array_000234[3].Reset();
+      v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
+      if ( v14 )
+        sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v11);
+      else
+        sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v11);
+      ShowStatusBarString(pTmpBuf2.data(), 2u);
+      if ( !pParty->AddItemToParty(&Dst) )
+        pParty->SetHoldingItem(&Dst);
+      itemFound = true;
+    }
+  }
+  else
+  {
+    if ( rand() % 100 < this->pMonsterInfo.uTreasureDropChance && (v7 = this->pMonsterInfo.uTreasureLevel) != 0 )
+    {
+  pItemsTable->GenerateItem(v7, this->pMonsterInfo.uTreasureType, &Dst);
+  v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
+  if ( v14 )
+    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10);//  ^I[%d] ^L[;;]   (%s)!
+  else
+    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10);//  ^Pv[%s]!
+  ShowStatusBarString(pTmpBuf2.data(), 2);
+  if ( !pParty->AddItemToParty(&Dst) )
+    pParty->SetHoldingItem(&Dst);
+      itemFound = true;
+    }
+  }
+  if ( this->array_000234[0].uItemID )
+  {
+    if ( !pParty->AddItemToParty(this->array_000234) )
+    {
+      pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
+      pParty->SetHoldingItem(this->array_000234);
+      itemFound = true;
+    }
+    this->array_000234[0].Reset();
+  }
+  if ( this->array_000234[1].uItemID )
+  {
+    if ( !pParty->AddItemToParty(&this->array_000234[1]) )
+    {
+      pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
+      pParty->SetHoldingItem(&this->array_000234[1]);
+      itemFound = true;
+    }
+    this->array_000234[1].Reset();
+  }
+  if ( !itemFound || rand() % 100 < 90 )
+  {
+    this->Remove();
+  }
+}
+
+
+//----- (00427102) --------------------------------------------------------
+bool Actor::_427102_IsOkToCastSpell( signed int a2 )
+{
+  switch(a2)
+  {
+  case SPELL_BODY_POWER_CURE:
+    {
+      if ( this->sCurrentHP >= (signed int)this->pMonsterInfo.uHP )
+        return false;
+      return true;
+    }
+  case SPELL_LIGHT_DISPEL_MAGIC:
+    {
+      for (int i = 0; i < 20; i++)
+      {
+        if (pParty->pPartyBuffs[i].uExpireTime > 0)
+        {
+          return true;
+        }
+      }
+      for ( int i = 1; i <= 4; i++ )
+      {
+        for ( int j = 0; j < 22; j++ )
+        {
+          if (pPlayers[i]->pPlayerBuffs[j].uExpireTime > 0)
+          {
+            return true;
+          }
+        }
+      }
+      return false;
+    }
+  case SPELL_LIGHT_DAY_OF_PROTECTION:
+    {
+      return this->pActorBuffs[ACTOR_BUFF_DAY_OF_PROTECTION].uExpireTime <= 0;
+      break;
+    }
+  case SPELL_LIGHT_HOUR_OF_POWER:
+    {
+      return this->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime <= 0;
+      break;
+    }
+  case SPELL_DARK_PAIN_REFLECTION:
+    {
+      return this->pActorBuffs[ACTOR_BUFF_PAIN_REFLECTION].uExpireTime <= 0;
+      break;
+    }
+  case SPELL_BODY_HAMMERHANDS:
+    {
+      return this->pActorBuffs[ACTOR_BUFF_PAIN_HAMMERHANDS].uExpireTime <= 0;
+      break;
+    }
+  case SPELL_FIRE_HASTE:
+    {
+      return this->pActorBuffs[ACTOR_BUFF_HASTE].uExpireTime <= 0;
+      break;
+    }
+  case SPELL_AIR_SHIELD:
+    {
+      return this->pActorBuffs[ACTOR_BUFF_SHIELD].uExpireTime <= 0;
+      break;
+    }
+  case SPELL_EARTH_STONESKIN:
+    {
+      return this->pActorBuffs[ACTOR_BUFF_STONESKIN].uExpireTime <= 0;
+      break;
+    }
+  case SPELL_SPIRIT_BLESS:
+    {
+      return this->pActorBuffs[ACTOR_BUFF_BLESS].uExpireTime <= 0;
+      break;
+    }
+  case SPELL_SPIRIT_FATE:
+    {
+      return this->pActorBuffs[ACTOR_BUFF_FATE].uExpireTime <= 0;
+      break;
+    }
+  case SPELL_SPIRIT_HEROISM:
+    {
+      return this->pActorBuffs[ACTOR_BUFF_HEROISM].uExpireTime <= 0;
+      break;
+    }
+  default:
+    {
+      return true;
+    }
+  }
+}
+
+
+//----- (0042704B) --------------------------------------------------------
+ABILITY_INDEX Actor::special_ability_use_check( int a2 )
+{
+  signed int okToCastSpell1; // ebx@5
+  signed int okToCastSpell2; // edi@5
+
+  if ( this->pMonsterInfo.uSpecialAbilityType == 2
+    && this->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u
+    && rand() % 100 < 5 )
+    this->SummonMinion(a2);
+  okToCastSpell1 = this->_427102_IsOkToCastSpell(this->pMonsterInfo.uSpell1ID);
+  okToCastSpell2 = this->_427102_IsOkToCastSpell(this->pMonsterInfo.uSpell2ID);
+  if ( okToCastSpell1 && this->pMonsterInfo.uSpell1UseChance && rand() % 100 < this->pMonsterInfo.uSpell1UseChance )
+    return ABILITY_SPELL1;
+  if ( okToCastSpell2 && this->pMonsterInfo.uSpell2UseChance && rand() % 100 < this->pMonsterInfo.uSpell2UseChance )
+    return ABILITY_SPELL2;
+  if (this->pMonsterInfo.uAttack2Chance && rand() % 100 < this->pMonsterInfo.uAttack2Chance)
+    return ABILITY_ATTACK2;
+  return ABILITY_ATTACK1;
+}
+
+
+
+//----- (004273BB) --------------------------------------------------------
+bool Actor::_4273BB_DoesHitOtherActor( Actor *defender, int a3, int a4 )
+{
+  signed int v6; // ebx@1
+  signed int v7; // esi@1
+  int armorSum; // ebx@10
+  signed int a2a; // [sp+18h] [bp+Ch]@1
+
+  v6 = defender->pMonsterInfo.uAC;
+  v7 = 0;
+  a2a = 0;
+  if ( defender->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime > 0 )
+    v6 /= 2;
+  if ( defender->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 )
+    v7 = defender->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower;
+  if ( defender->pActorBuffs[ACTOR_BUFF_STONESKIN].uExpireTime > 0 && defender->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower > v7 )
+    v7 = defender->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower;
+  armorSum = v7 + v6;
+  if ( this->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 )
+    a2a = this->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower;
+  if ( this->pActorBuffs[ACTOR_BUFF_BLESS].uExpireTime > 0 && this->pActorBuffs[ACTOR_BUFF_BLESS].uPower > a2a )
+    a2a = this->pActorBuffs[ACTOR_BUFF_BLESS].uPower;
+  if ( this->pActorBuffs[ACTOR_BUFF_FATE].uExpireTime > 0 )
+  {
+    a2a += this->pActorBuffs[ACTOR_BUFF_FATE].uPower;
+    this->pActorBuffs[ACTOR_BUFF_FATE].Reset();
+  }
+  return rand() % (armorSum + 2 * this->pMonsterInfo.uLevel + 10) + a2a + 1 > armorSum + 5;
+}
\ No newline at end of file
--- a/Actor.h	Fri Nov 01 14:43:54 2013 +0600
+++ b/Actor.h	Fri Nov 01 14:44:06 2013 +0600
@@ -12,12 +12,8 @@
 #pragma pack(push, 1)
 struct stru319
 {
-  void LootActor(struct Actor *pActor);
   int which_player_to_attack(struct Actor *pActor);
-  int  special_ability_use_check(struct Actor *pActor, int a2);
-  int _427102(struct Actor *pActor, signed int a2);
   int PlayerHitOrMiss(struct Player *pPlayer, struct Actor *pActor, int a3, int a4);
-  bool _4273BB(struct Actor *pActor, struct Actor *a2, int a3, int a4);
   bool ActorHitOrMiss(struct Actor *pActor, struct Player *pPlayer);
   int _427546(int a2);
   int CalcMagicalDamageToActor(struct Actor *pActor, int a2, signed int a3);
@@ -32,7 +28,13 @@
 extern stru319 stru_50C198; // idb
 
 
-
+enum ABILITY_INDEX
+{
+  ABILITY_ATTACK1 = 0,
+  ABILITY_ATTACK2 = 1,
+  ABILITY_SPELL1 = 2,
+  ABILITY_SPELL2 = 3,
+};
 
 
 
@@ -248,6 +250,12 @@
   static bool _46DF1A_collide_against_actor(int a1, int a2);
   static void _4BBF61_summon_actor(int a1, __int16 x, int y, int z); // idb
 
+
+  void LootActor();
+  bool _427102_IsOkToCastSpell(signed int a2);
+  ABILITY_INDEX special_ability_use_check(int a2);
+  bool _4273BB_DoesHitOtherActor(Actor *defender, int a3, int a4);
+
   char pActorName[32];
   signed __int16 sNPC_ID;
   __int16 field_22;
--- a/Arcomage.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Arcomage.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -271,7 +271,7 @@
 //----- (0040E01A) --------------------------------------------------------
 int stru272_stru0::StartFill( stru272_stru2* a2 )
     {
-    auto a1 = this;
+    stru272_stru0* a1 = this;
     if ( a1->signature == SIG_trpg )
         {
         a1->field_4 = a2->field_20;
@@ -3900,7 +3900,7 @@
         if ( !pParty->pArcomageWins[v8-108] )
         {
           pParty->pArcomageWins[v8-108] = 1;
-          auto _a = (signed int)(p2DEvents[ window_SpeakInHouse->par1C - 1].fPriceMultiplier * 100.0);
+          signed int _a = (signed int)(p2DEvents[ window_SpeakInHouse->par1C - 1].fPriceMultiplier * 100.0);
           pParty->PartyFindsGold(_a, 0);
         }
       
--- a/AudioPlayer.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/AudioPlayer.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -165,7 +165,7 @@
     return uSoundIdx;
 
 
-  auto pSoundData = pSound->pSoundData[0];
+  SoundData* pSoundData = pSound->pSoundData[0];
   switch (AIL_file_type((void *)pSoundData->pData, pSoundData->uDataSize))
   {
     default:
@@ -404,7 +404,7 @@
   for (uint i = 0; i < num_mm6_sounds; ++i)
   {
     auto src = (SoundDesc_mm6 *)((char *)data_mm6 + 4) + i;
-    auto dst = pSounds + num_mm7_sounds + i;
+    SoundDesc* dst = &pSounds[num_mm7_sounds + i];
 
     memcpy(dst, src, sizeof(SoundDesc_mm6));
     dst->p3DSound = nullptr;
@@ -723,7 +723,7 @@
       end_channel = 0;
 
   assert(sound_id < pSoundList->sNumSounds);
-  auto sound_desc = pSoundList->pSounds + sound_id;
+  SoundDesc* sound_desc = pSoundList->pSounds + sound_id;
   if (!b3DSoundInitialized || sound_desc->Is3D())
   {
     if (!a3)  // generic sound like from UI
@@ -767,7 +767,7 @@
             end_channel = 3;
 
             assert(object_id < uNumActors);
-            auto actor = &pActors[object_id];
+            Actor* actor = &pActors[object_id];
 
             sample_volume = GetSoundStrengthByDistanceFromParty(actor->vPosition.x, actor->vPosition.y, actor->vPosition.z);
             if (!sample_volume)
@@ -781,7 +781,7 @@
             end_channel = 4;
 
             assert(object_id < uNumLevelDecorations);
-            auto decor = &pLevelDecorations[object_id];
+            LevelDecoration* decor = &pLevelDecorations[object_id];
 
             sample_volume = GetSoundStrengthByDistanceFromParty(decor->vPosition.x, decor->vPosition.y, decor->vPosition.z);
             if (!sample_volume)
@@ -796,7 +796,7 @@
             end_channel = 7;
 
             assert(object_id < uNumSpriteObjects);
-            auto object = &pSpriteObjects[object_id];
+            SpriteObject* object = &pSpriteObjects[object_id];
 
             sample_volume = GetSoundStrengthByDistanceFromParty(object->vPosition.x, object->vPosition.y, object->vPosition.z);
             if (!sample_volume)
@@ -821,7 +821,7 @@
 LABEL_123:
     for (uint i = 0; i < uMixerChannels; ++i)
     {
-      auto channel = pMixerChannels + i;
+      MixerChannel* channel = &pMixerChannels[i];
       if (channel->source_pid == a3 &&
           AIL_sample_status(channel->hSample) == AIL::Sample::Playing)
       {
@@ -836,7 +836,7 @@
       //pAudioPlayer4 = pAudioPlayer;
       for (v62 = start_channel; v62 <= end_channel; ++v62)
       {
-        auto channel = pMixerChannels + v62;
+        MixerChannel* channel = pMixerChannels + v62;
         if (AIL_sample_status(channel->hSample) == AIL::Sample::Done)
         {
           AIL_end_sample(channel->hSample);
@@ -868,7 +868,7 @@
         int min_volume = sample_volume;
         for (uint i = start_channel; i <= end_channel; ++i)
         {
-          auto channel = pMixerChannels + i;
+          MixerChannel* channel = &pMixerChannels[i];
 
           int volume = AIL_sample_volume(channel->hSample);
           if (volume < min_volume)
@@ -903,7 +903,7 @@
           v62 = 13;
         }
 
-        auto channel = &pMixerChannels[v62];
+        MixerChannel* channel = &pMixerChannels[v62];
         AIL_end_sample(channel->hSample);
         FreeChannel(channel);
       }
@@ -931,7 +931,7 @@
         return;
 
         //pMixerChannel5 = &pAudioPlayer->pMixerChannels[v62];
-      auto channel = &pMixerChannels[v62];
+      MixerChannel* channel = &pMixerChannels[v62];
       AIL_init_sample(channel->hSample);
       AIL_set_sample_file(channel->hSample, (char *)pSoundList->pSounds[sound_id].pSoundData[a7] + 4 * (a7 == 0), -1);
       if (uVolume)
@@ -952,7 +952,7 @@
         assert(uCurrentlyLoadedLevelType == LEVEL_Indoor);
 
         assert(object_id < pIndoor->uNumDoors);
-        auto door = &pIndoor->pDoors[object_id];
+        BLVDoor* door = &pIndoor->pDoors[object_id];
         if (!door->uDoorID)
           return;
 
@@ -967,7 +967,7 @@
       else if (object_type == OBJECT_Item)
       {
         assert(object_id < uNumSpriteObjects);
-        auto object = &pSpriteObjects[object_id];
+        SpriteObject* object = &pSpriteObjects[object_id];
         if (!GetSoundStrengthByDistanceFromParty(object->vPosition.x, object->vPosition.y, object->vPosition.z) )
             return;
         AIL_set_sample_pan(channel->hSample, sub_4AB66C(object->vPosition.x, object->vPosition.y));
@@ -975,7 +975,7 @@
       else if (object_type == OBJECT_Actor)
       {
         assert(object_id < uNumActors);
-        auto actor = &pActors[object_id];
+        Actor* actor = &pActors[object_id];
         if (!GetSoundStrengthByDistanceFromParty(actor->vPosition.x, actor->vPosition.y, actor->vPosition.z))
           return;
         AIL_set_sample_pan(channel->hSample, sub_4AB66C(actor->vPosition.x, actor->vPosition.y));
@@ -983,7 +983,7 @@
       else if (object_type == OBJECT_Decoration)
       {
         assert(object_id < uNumLevelDecorations);
-        auto decor = &pLevelDecorations[object_id];
+        LevelDecoration* decor = &pLevelDecorations[object_id];
         if (!GetSoundStrengthByDistanceFromParty(decor->vPosition.x, decor->vPosition.y, decor->vPosition.z))
           return;
         AIL_set_sample_pan(channel->hSample, sub_4AB66C(decor->vPosition.x, decor->vPosition.y));
@@ -1640,7 +1640,7 @@
         continue;
     }
 
-    if (auto sound_strength = GetSoundStrengthByDistanceFromParty(source_x, source_y, source_z))
+    if (int sound_strength = GetSoundStrengthByDistanceFromParty(source_x, source_y, source_z))
     {
       AIL_set_sample_volume(pMixerChannels[i].hSample, sound_strength);
       AIL_set_sample_pan(pMixerChannels[i].hSample, sub_4AB66C(source_x, source_y));
@@ -1656,7 +1656,7 @@
 
   if (pCurrentScreen != SCREEN_GAME)
   {
-    auto channel = &pMixerChannels[4];
+    MixerChannel* channel = &pMixerChannels[4];
     if (AIL_sample_status(channel->hSample) == AIL::Sample::Playing)
       AIL_end_sample(channel->hSample);
     return;
@@ -1676,13 +1676,13 @@
         //v45 = abs(v44->vPosition.z - pParty->vPosition.z);
         //v46 = abs(v44->vPosition.y - pParty->vPosition.y);
         //v47 = abs(v44->vPosition.x - pParty->vPosition.x);
-    auto decor = &pLevelDecorations[_6807B8_level_decorations_ids[i]];
+    LevelDecoration* decor = &pLevelDecorations[_6807B8_level_decorations_ids[i]];
     if (int_get_vector_length(decor->vPosition.x - pParty->vPosition.x,
                               decor->vPosition.y - pParty->vPosition.y,
                               decor->vPosition.z - pParty->vPosition.z) > 8192)
       continue;
 
-    auto decor_desc = &pDecorationList->pDecorations[decor->uDecorationDescID];
+    DecorationDesc* decor_desc = &pDecorationList->pDecorations[decor->uDecorationDescID];
       //v48 = &pDecorationList->pDecorations[decor->uDecorationDescID];
       //v49 = v48->uFlags;
       uNumRepeats = (~(unsigned __int8)decor_desc->uFlags & DECORATION_DESC_SLOW_LOOP) >> 6;
--- a/CastSpellInfo.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/CastSpellInfo.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -555,7 +555,7 @@
 			int _v733 = 0;
 			for (uint i = 0; i < uNumSpriteObjects; ++i)
 			{
-				auto object = &pSpriteObjects[i];
+				SpriteObject* object = &pSpriteObjects[i];
 				if (object->uType && object->spell_id == SPELL_FIRE_FIRE_SPIKE && object->spell_caster_pid == PID(OBJECT_Player, pCastSpell->uPlayerID))
 				++_v733;
 				/*v33 = (char *)&pSpriteObjects[0].field_48;
@@ -637,7 +637,7 @@
 			pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z;
 			pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y;
 			pSpellSprite.spell_target_pid = PID(OBJECT_Actor, PID_ID(a2));
-			auto obj_id = pSpellSprite.Create(0, 0, 0, 0);
+			int obj_id = pSpellSprite.Create(0, 0, 0, 0);
 			DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v697);
 			LODWORD(v727) = 1;
 			break;
@@ -651,7 +651,7 @@
 				LODWORD(v727) = 1;
 				break;
 			}
-			pActors[PID_ID(a2)].pActorBuffs[10].Apply(pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0);
+			pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].Apply(pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0);
 			v704.x = 0;
 			v704.y = 0;
 			v704.z = 0;
@@ -671,7 +671,7 @@
 			pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y;
 			pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z;
 			pSpellSprite.spell_target_pid = PID(OBJECT_Actor, PID_ID(a2));
-			auto obj_id = pSpellSprite.Create(0, 0, 0, 0);
+			int obj_id = pSpellSprite.Create(0, 0, 0, 0);
 			DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v704);
 			LODWORD(v727) = 1;
 			break;
@@ -702,7 +702,7 @@
 			pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
 			pSpellSprite.uAttributes |= 0x80u;
 			pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
-			auto obj_id = pSpellSprite.Create(0, 0, 0, 0);
+			int obj_id = pSpellSprite.Create(0, 0, 0, 0);
 			if ( !MonsterStats::BelongsToSupertype(pActor->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
@@ -848,7 +848,7 @@
 			Actor::AI_Stand(PID_ID(a2), 4u, 0x80u, 0);
 			v54 = (signed __int64)((double)(23040 * v2) * 0.033333335);
 			v55 = &pActors[PID_ID(a2)];
-			v55->pActorBuffs[6].Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0);
+			v55->pActorBuffs[ACTOR_BUFF_PARALYZED].Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0);
 			BYTE2(v55->uAttributes) |= 8u;
 			v55->vVelocity.x = 0;
 			//v672 = 0;
@@ -882,8 +882,8 @@
 			v58 = (signed __int64)((double)(23040 * v2) * 0.033333335);
 			//v59 = v721;
 			pActor = &pActors[PID_ID(a2)];
-			//((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply(
-			pActor->pActorBuffs[7].Apply(pParty->uTimePlayed + (signed int)v58,	v731, amount, 0, 0);
+			//((SpellBuff *)((char *)&pActors[0].pActorBuffs[ACTOR_BUFF_SLOWED] + v721))->Apply(
+			pActor->pActorBuffs[ACTOR_BUFF_SLOWED].Apply(pParty->uTimePlayed + (signed int)v58,	v731, amount, 0, 0);
 			//*((char *)&pActors[0].uAttributes + v59 + 2) |= 8u;
 			BYTE2(pActor->uAttributes) |= 8u;
 			//v672 = 0;
@@ -911,12 +911,12 @@
 		else if ( v731 == 3 )
 			power  = 29030400;
 
-		//((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset();
-		pActors[PID_ID(a2)].pActorBuffs[9].Reset();
-		//((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset();
-		pActors[PID_ID(a2)].pActorBuffs[12].Reset();
-		//((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply(
-		pActors[PID_ID(a2)].pActorBuffs[1].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(power << 7) * 0.033333335),
+		//((SpellBuff *)((char *)&pActors[0].pActorBuffs[ACTOR_BUFF_BERSERK] + v730))->Reset();
+		pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_BERSERK].Reset();
+		//((SpellBuff *)((char *)&pActors[0].pActorBuffs[ACTOR_BUFF_ENSLAVED] + v730))->Reset();
+		pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_ENSLAVED].Reset();
+		//((SpellBuff *)((char *)&pActors[0].pActorBuffs[ACTOR_BUFF_CHARM] + v730))->Apply(
+		pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_CHARM].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(power << 7) * 0.033333335),
 			v731, 0, 0, 0);
 		pSpellSprite.stru_24.Reset();
 		pSpellSprite.spell_id = pCastSpell->uSpellID;
@@ -996,7 +996,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 			v730c = &pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItemList[a2];
-			auto _itm = &pItemsTable->pItems[v730c->uItemID];
+			ItemDesc* _itm = &pItemsTable->pItems[v730c->uItemID];
 			v730c->UpdateTempBonus(pParty->uTimePlayed);
 			if ( v730c->uItemID < 64 || v730c->uItemID > 65 
 				&& !v730c->IsBroken()
@@ -1418,7 +1418,7 @@
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			auto _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096);
+			int _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096);
 			v700.z = 0;
 			v700.y = 0;
 			v700.x = 0;
@@ -1512,7 +1512,7 @@
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			auto _v726 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
+			int _v726 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
 			pSpellSprite.stru_24.Reset();
 			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
@@ -1707,7 +1707,7 @@
 				pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
 				pSpellSprite.spell_target_pid = v730;
 				//__debugbreak();//
-				pSpellSprite.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges);
+				pSpellSprite.field_60_distance_related_prolly_lod = stru_50C198._427546(((int)_this) + 2500);
 				pSpellSprite.uFacing = v685;
 				pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
 				if ( pParty->bTurnBasedModeOn == 1 )
@@ -2309,7 +2309,7 @@
 				v343 = PID_ID(v342);
 				HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32);
 				LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280;
-				pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0);
+				pActors[v343].pActorBuffs[ACTOR_BUFF_FATE].Apply(v344, v731, amount, 0, 0);
 				BYTE2(pActors[v343].uAttributes) |= 8u;
 				//v672 = 0;
 				v661 = &pActors[v343];
@@ -2393,7 +2393,7 @@
 				LODWORD(v733) = 300 * v2 + 180;
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			auto _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096);
+			int _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096);
 			pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u);
 			++pSpellSprite.uType;
 			pSpellSprite.stru_24.Reset();
@@ -2419,7 +2419,7 @@
 
 					pSpellSprite.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]);
 					pSpellSprite.Create(0, 0, 0, 0);
-					v369->pActorBuffs[4].Apply(
+					v369->pActorBuffs[ACTOR_BUFF_AFRAID].Apply(
 						pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
 						v731, 0, 0, 0);
 				}
@@ -2768,9 +2768,9 @@
 			v730 = 836 * v426;
 			if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) )
 			{
-				pActors[v426].pActorBuffs[1].Reset();
-				pActors[v426].pActorBuffs[12].Reset();
-				pActors[v426].pActorBuffs[9].Apply(
+				pActors[v426].pActorBuffs[ACTOR_BUFF_CHARM].Reset();
+				pActors[v426].pActorBuffs[ACTOR_BUFF_ENSLAVED].Reset();
+				pActors[v426].pActorBuffs[ACTOR_BUFF_BERSERK].Apply(
 				pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
 				v731, 0, 0, 0);
 				pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
@@ -2820,9 +2820,9 @@
 				break;
 			if ( stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 7u) )
 			{
-				pActors[PID_ID(a2)].pActorBuffs[9].Reset();
-				pActors[PID_ID(a2)].pActorBuffs[1].Reset();
-				pActors[PID_ID(a2)].pActorBuffs[12].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
+				pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_BERSERK].Reset();
+				pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_CHARM].Reset();
+				pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_ENSLAVED].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
 				v731, 0, 0, 0);
 			}
 			pSpellSprite.stru_24.Reset();
@@ -2863,7 +2863,7 @@
 				amount = 180 * v2;
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			auto _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096);
+			int _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096);
 			pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u);
 			++pSpellSprite.uType;
 			pSpellSprite.stru_24.Reset();
@@ -2891,7 +2891,7 @@
 				pSpellSprite.Create(0, 0, 0, 0);
 				if ( stru_50C198.GetMagicalResistance(v433, 7u) )
 				{
-					v433->pActorBuffs[4].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
+					v433->pActorBuffs[ACTOR_BUFF_AFRAID].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
 						v731, 0, 0, 0);
 				}
 			}
@@ -2967,7 +2967,7 @@
 			{
 				if (PID_TYPE(a2) == OBJECT_Actor)
 				{
-					stru_50C198.LootActor(&pActors[v445]);
+					pActors[v445].LootActor();
 				}
 				else
 				{
@@ -3313,7 +3313,7 @@
 			if ( (signed int)uNumActors > 0 )
 			{
 				v518 = pActors.data();//[0].uAIState;
-				auto _v726 = uNumActors;
+				size_t _v726 = uNumActors;
 				do
 				{
 					v519 = v518->uAIState;
@@ -3687,7 +3687,7 @@
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			auto _v726 = ((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
+			signed int _v726 = ((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
 			pSpellSprite.stru_24.Reset();
 			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
@@ -3758,9 +3758,9 @@
 				pCastSpell->uSpellID = 0;
 				continue;
 			}
-			pActor->pActorBuffs[9].Reset();
-			pActor->pActorBuffs[1].Reset();
-			pActor->pActorBuffs[12].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
+			pActor->pActorBuffs[ACTOR_BUFF_BERSERK].Reset();
+			pActor->pActorBuffs[ACTOR_BUFF_CHARM].Reset();
+			pActor->pActorBuffs[ACTOR_BUFF_ENSLAVED].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
 				v731, 0, 0, 0);
 			pSpellSprite.stru_24.Reset();
 			pSpellSprite.spell_id = pCastSpell->uSpellID;
@@ -4015,7 +4015,7 @@
 			++pPlayer->uNumArmageddonCasts;
 			if ( pParty->bTurnBasedModeOn == 1 )
 				++pTurnEngine->pending_actions;
-			auto _v726 = 50;
+			int _v726 = 50;
 			do
 			{
 				v642 = rand() % 4096 - 2048;
@@ -4154,7 +4154,7 @@
     //v6 = a5;
     //v7 = &pParty->pPlayers[uPlayerID];
   assert(uPlayerID < 4);
-  auto player = &pParty->pPlayers[uPlayerID];
+  Player* player = &pParty->pPlayers[uPlayerID];
     if ( !(a5 & 0x10) )
     {
       switch ( a1 )
@@ -4319,7 +4319,7 @@
       
     for (uint i = 0; i < CastSpellInfoCount; ++i)
     {
-      auto spell = &pCastSpellInfo[i];
+      CastSpellInfo* spell = &pCastSpellInfo[i];
       if (!spell->uSpellID)
         continue;
 
--- a/Chest.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Chest.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -67,7 +67,7 @@
   assert( uChestID < 20 );
   if ( ( uChestID < 0 ) && ( uChestID >= 20 ) )
     return false;
-  auto chest = &pChests[uChestID];
+  Chest* chest = &pChests[uChestID];
 
   ++pIcons_LOD->uTexturePacksCount;
   if (!pIcons_LOD->uNumPrevLoadedFiles)
@@ -212,7 +212,7 @@
     v1 = pRenderer->pActiveZBuffer[v0->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v3)->y]];
     if ( v1 )
     {
-      auto _w = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C
+      ItemGen* _w = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C
                                              + 18 * *((short *)&pChests[0].igChestItems[139].uExpireTime
                                                + v1 + 2662 * (unsigned int)pChestWindow->ptr_1C + 3));
 
--- a/DecalBuilder.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/DecalBuilder.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -454,7 +454,7 @@
   if (!pBloodsplatContainer->std__vector_pBloodsplats_size)
     return true;
   
-  auto pFace = &pIndoor->pFaces[uFaceID];
+  BLVFace* pFace = &pIndoor->pFaces[uFaceID];
 
   if (pFace->uAttributes & 0x400000)
     return true;
@@ -462,7 +462,7 @@
     return true;
   for (uint i = 0; i < pBloodsplatContainer->std__vector_pBloodsplats_size; ++i)
   {
-    auto pBloodsplat = pBloodsplatContainer->std__vector_pBloodsplats + i;
+    Bloodsplat* pBloodsplat = &pBloodsplatContainer->std__vector_pBloodsplats[i];
     if (pFace->pBounding.x1 - pBloodsplat->radius < pBloodsplat->x &&
         pFace->pBounding.x2 + pBloodsplat->radius > pBloodsplat->x &&
         pFace->pBounding.y1 - pBloodsplat->radius < pBloodsplat->y &&
@@ -741,7 +741,7 @@
   ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE));
   ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE));
 
-  auto pTex = pGame->pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("hwsplat04");
+  IDirect3DTexture2* pTex = pGame->pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("hwsplat04");
   ErrD3D(pRenderer->pRenderD3D->pDevice->SetTexture(0, pTex));
  
   DrawDecals(0.00039999999);
--- a/DecalBuilder.h	Fri Nov 01 14:43:54 2013 +0600
+++ b/DecalBuilder.h	Fri Nov 01 14:44:06 2013 +0600
@@ -140,7 +140,7 @@
     char *v2; // eax@1
     signed int v3; // ecx@1
 
-    auto v1 = this;
+    DecalBuilder* v1 = this;
     /*_eh_vector_constructor_iterator_(
     this->std__vector_pDecals,
     3104,
--- a/Events.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Events.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -465,7 +465,7 @@
       {
       //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT;
       //v10 = (ByteArray *)&v5[v9];
-      auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[v4].uEventOffsetInEVT);
+      _evt_raw * _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[v4].uEventOffsetInEVT);
 
       switch (_evt->_e_type)
         {
--- a/GUIWindow.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/GUIWindow.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -342,6 +342,8 @@
         pIcons_LOD->SyncLoadedFilesCount();
         pCurrentScreen = pMainScreenNum;
 		}
+  case WINDOW_null:
+    return;
 	default:
 		{
 		break;
@@ -807,7 +809,7 @@
   //v3 = 0;
   a2 = 0;
 
-  auto chapter = &pPlayer->spellbook.pChapters[pPlayer->lastOpenedSpellbookPage];
+  PlayerSpellbookChapter* chapter = &pPlayer->spellbook.pChapters[pPlayer->lastOpenedSpellbookPage];
   for (uint i = 0; i < 11; ++i)
   {
     if (!chapter->bIsSpellAvailable[i])
@@ -1184,7 +1186,7 @@
   const char *v32; // [sp+34h] [bp-4h]@7
   size_t pInString; // [sp+4Ch] [bp+14h]@11
   
-  auto a1 = this;
+  GUIWindow* a1 = this;
   v29 = 0;
   v9 = a1;
   v10 = a2;
@@ -1555,7 +1557,7 @@
       break;
   }
 
-  auto pWindow = &pWindowList[uNextFreeWindowID];
+  GUIWindow* pWindow = &pWindowList[uNextFreeWindowID];
   pWindow->uFrameWidth = uWidth;
   pWindow->uFrameHeight = uHeight;
 
--- a/Game.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Game.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -206,7 +206,7 @@
   static uint last_frame_time = GetTickCount();
   static uint framerate_time_elapsed = 0;
 
-  auto frame_dt = GetTickCount() - last_frame_time;
+  uint frame_dt = GetTickCount() - last_frame_time;
   last_frame_time = GetTickCount();
 
   framerate_time_elapsed += frame_dt;
@@ -232,7 +232,7 @@
 
     if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
     {
-      auto sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
+      int sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
       sprintf(pTmpBuf.data(), "Party Sector ID:        %u/%u\n", sector_id, pIndoor->uNumSectors);
       pPrimaryWindow->DrawText(pFontArrus, 16, 16, TargetColor(255, 255, 255), pTmpBuf.data(), 0, 0, 0xFFFFFFFF);
     }
@@ -242,14 +242,14 @@
     if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
     {
       uint uFaceID;
-      auto sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
-      auto floor_level = BLV_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + 40, sector_id, &uFaceID);
+      int sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
+      int floor_level = BLV_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + 40, sector_id, &uFaceID);
       sprintf(pTmpBuf.data(), "BLV_GetFloorLevel: %d   face_id %d\n", floor_level, uFaceID);
     }
     else
     {
       int on_water, _a6;
-      auto floor_level = ODM_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z, 0, &on_water, &_a6, false);
+      int floor_level = ODM_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z, 0, &on_water, &_a6, false);
       sprintf(pTmpBuf.data(), "ODM_GetFloorLevel: %d   on_water: %s    a6 = %d\n", floor_level, on_water ? "true" : "false", _a6);
     }
     pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16 + 16, TargetColor(255, 255, 255), pTmpBuf.data(), 0, 0, 0xFFFFFFFF);
@@ -1145,7 +1145,7 @@
   if (!pVisInstance->default_list.uNumPointers)
     return;
 
-  auto object_info = pVisInstance->default_list.object_pointers[0];
+  Vis_ObjectInfo* object_info = pVisInstance->default_list.object_pointers[0];
   if (object_info)
     switch (object_info->object_type)
     {
@@ -1159,7 +1159,7 @@
       {
         if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
         {
-          auto face = (ODMFace *)object_info->object;
+          ODMFace* face = (ODMFace *)object_info->object;
           if (face->uAttributes & FACE_OUTLINED)
             face->uAttributes &= ~FACE_OUTLINED;
           else
@@ -1167,7 +1167,7 @@
         }
         else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
         {
-          auto face = (BLVFace *)object_info->object;
+          BLVFace* face = (BLVFace *)object_info->object;
           if (face->uAttributes & FACE_OUTLINED)
             face->uAttributes &= ~FACE_OUTLINED;
           else
@@ -1478,7 +1478,7 @@
             //_this = 0;
             for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
             {
-              auto npc = pNPCStats->pNewNPCData + i;
+              NPCData* npc = &pNPCStats->pNewNPCData[i];
               //do
               //{
                 if (npc->Hired() &&
@@ -3542,7 +3542,7 @@
           if ( pParty->bTurnBasedModeOn != 1 )
           {
             if ( pActors[uMessageParam].uAIState == 5 )
-              stru_50C198.LootActor(&pActors[uMessageParam]);
+              pActors[uMessageParam].LootActor();
             else
               Actor::StealFrom(uMessageParam);
             continue;
@@ -3552,7 +3552,7 @@
           if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) )
           {
             if ( pActors[uMessageParam].uAIState == 5 )
-              stru_50C198.LootActor(&pActors[uMessageParam]);
+              pActors[uMessageParam].LootActor();
             else
               Actor::StealFrom(uMessageParam);
           }
@@ -3856,7 +3856,7 @@
             continue;
 
             //  uNumSeconds = (unsigned int)pPlayers[uActiveCharacter];
-          auto player = pPlayers[uActiveCharacter];
+          Player* player = pPlayers[uActiveCharacter];
           if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam])
               //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) )
           {
--- a/IconFrameTable.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/IconFrameTable.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -98,7 +98,7 @@
   FILE *v2; // eax@1
   FILE *v3; // edi@1
 
-  auto Str = this;
+  IconFrameTable* Str = this;
 
   v1 = Str;
   v2 = fopen("data\\dift.bin", "wb");
--- a/Indoor.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Indoor.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -508,7 +508,7 @@
   static stru154 stru_F7B60C; // idb
 
     //v9 = &pIndoor->pFaces[uFaceID];
-  auto pFace = &pIndoor->pFaces[uFaceID];
+  BLVFace* pFace = &pIndoor->pFaces[uFaceID];
   if (pFace->uNumVertices < 3)
     return;
 
@@ -702,7 +702,7 @@
   nodes[num_nodes].viewing_portal_id = -1;
   //v39 = &pIndoor->pFaces[uFaceID];
 
-  auto pFace = &pIndoor->pFaces[uFaceID];
+  BLVFace* pFace = &pIndoor->pFaces[uFaceID];
 
   if (!pFace->Portal())
   {
@@ -752,13 +752,13 @@
   if (v9 >= 0)
     return;
 
-  auto num_vertices = GetPortalScreenCoord(uFaceID);
+  int num_vertices = GetPortalScreenCoord(uFaceID);
   if (num_vertices < 2)
     return;
 
-  auto face_min_screenspace_x = PortalFace._screen_space_x[0],
+  int face_min_screenspace_x = PortalFace._screen_space_x[0],
        face_max_screenspace_x = PortalFace._screen_space_x[0];
-  auto face_min_screenspace_y = PortalFace._screen_space_y[0],
+  int face_min_screenspace_y = PortalFace._screen_space_y[0],
        face_max_screenspace_y = PortalFace._screen_space_y[0];
   for (uint i = 1; i < num_vertices; ++i)
   {
@@ -1796,14 +1796,14 @@
   //v84 = malloc(header.uDecompressedSize);
   //v85 = v84;
   //ptr = v84;
-  auto pRawBLV = malloc(header.uDecompressedSize);
+  void* pRawBLV = malloc(header.uDecompressedSize);
   memset(pRawBLV, 0, header.uDecompressedSize);
 
   if (header.uCompressedSize == header.uDecompressedSize)
     fread(pRawBLV, header.uDecompressedSize, 1, File);
   else if (header.uCompressedSize < header.uDecompressedSize)
   {
-    auto pTmpMem = malloc(header.uCompressedSize);
+    void* pTmpMem = malloc(header.uCompressedSize);
     {
       fread(pTmpMem, header.uCompressedSize, 1, File);
 
@@ -1823,7 +1823,7 @@
   
   bLoaded = true;
 
-  auto pData = (char *)pRawBLV;
+  char* pData = (char *)pRawBLV;
   
   pGameLoadingUI_ProgressBar->Progress();
 
@@ -1844,24 +1844,24 @@
 
   for (uint i = 0, j = 0; i < uNumFaces; ++i)
   {
-    auto pFace = pFaces + i;
-
-    pFace->pVertexIDs = pLFaces + j;
+    BLVFace* pFace = &pFaces[i];
+
+    pFace->pVertexIDs = &pLFaces[j];
     
     j += pFace->uNumVertices + 1;
-    pFace->pXInterceptDisplacements = (short *)(pLFaces + j);
+    pFace->pXInterceptDisplacements = (short *)(&pLFaces[j]);
 
     j += pFace->uNumVertices + 1;
-    pFace->pYInterceptDisplacements = (short *)(pLFaces + j);
+    pFace->pYInterceptDisplacements = (short *)(&pLFaces[j]);
 
     j += pFace->uNumVertices + 1;
-    pFace->pZInterceptDisplacements = (short *)(pLFaces + j);
+    pFace->pZInterceptDisplacements = (short *)(&pLFaces[j]);
 
     j += pFace->uNumVertices + 1;
-    pFace->pVertexUIDs = (__int16 *)(pLFaces + j);
+    pFace->pVertexUIDs = (__int16 *)(&pLFaces[j]);
 
     j += pFace->uNumVertices + 1;
-    pFace->pVertexVIDs = (__int16 *)(pLFaces + j);
+    pFace->pVertexVIDs = (__int16 *)(&pLFaces[j]);
 
     j += pFace->uNumVertices + 1;
       /*v93 = &pFaces[v92];
@@ -1899,7 +1899,7 @@
 
   for (uint i = 0; i < uNumFaces; ++i)
   {
-    auto pFace = pFaces + i;
+    BLVFace* pFace = &pFaces[i];
 
     char pTexName[16];
     strncpy(pTexName, pData, 10);
@@ -1946,8 +1946,8 @@
 
   for (uint i = 0; i < uNumFaces; ++i)
   {
-    auto pFace = pFaces + i;
-    auto pFaceExtra = pFaceExtras + pFace->uFaceExtraID;
+    BLVFace* pFace = &pFaces[i];
+    BLVFaceExtra* pFaceExtra = &pFaceExtras[pFace->uFaceExtraID];
 
     if (pFaceExtra->uEventID)
     {
@@ -1972,33 +1972,33 @@
 
   for (uint i = 0, j = 0; i < uNumSectors; ++i)
   {
-    auto pSector = pSectors + i;
-
-    pSector->pFloors = ptr_0002B0_sector_rdata + j;
+    BLVSector* pSector = &pSectors[i];
+
+    pSector->pFloors = &ptr_0002B0_sector_rdata[j];
     j += pSector->uNumFloors;
 
-    pSector->pWalls = ptr_0002B0_sector_rdata + j;
+    pSector->pWalls = &ptr_0002B0_sector_rdata[j];
     j += pSector->uNumWalls;
 
-    pSector->pCeilings = ptr_0002B0_sector_rdata + j;
+    pSector->pCeilings = &ptr_0002B0_sector_rdata[j];
     j += pSector->uNumCeilings;
 
-    pSector->pFluids = ptr_0002B0_sector_rdata + j;
+    pSector->pFluids = &ptr_0002B0_sector_rdata[j];
     j += pSector->uNumFluids;
 
-    pSector->pPortals = ptr_0002B0_sector_rdata + j;
+    pSector->pPortals = &ptr_0002B0_sector_rdata[j];
     j += pSector->uNumPortals;
 
-    pSector->pFaceIDs = ptr_0002B0_sector_rdata + j;
+    pSector->pFaceIDs = &ptr_0002B0_sector_rdata[j];
     j += pSector->uNumFaces;
 
-    pSector->pCogs = ptr_0002B0_sector_rdata + j;
+    pSector->pCogs = &ptr_0002B0_sector_rdata[j];
     j += pSector->uNumCogs;
 
-    pSector->pDecorationIDs = ptr_0002B0_sector_rdata + j;
+    pSector->pDecorationIDs = &ptr_0002B0_sector_rdata[j];
     j += pSector->uNumDecorations;
 
-    pSector->pMarkers = ptr_0002B0_sector_rdata + j;
+    pSector->pMarkers = &ptr_0002B0_sector_rdata[j];
     j += pSector->uNumMarkers;
 
 
@@ -2135,7 +2135,7 @@
       fread(pRawDLV, 1, header.uCompressedSize, File);
     else if (header.uCompressedSize < header.uDecompressedSize)
     {
-      auto pTmpMem = malloc(header.uCompressedSize);
+      void* pTmpMem = malloc(header.uCompressedSize);
       {
         fread(pTmpMem, header.uCompressedSize, 1, File);
 
@@ -2192,9 +2192,9 @@
     *(int *)pDest = 1;
     File = pGames_LOD->FindContainer(pFilename, 0);
     fread(&header, 0x10u, 1u, File);
-    auto v155 = header.uCompressedSize;
-    auto Count = header.uDecompressedSize;
-    auto Src = (BLVFace *)malloc(header.uDecompressedSize);
+    uint v155 = header.uCompressedSize;
+    uint Count = header.uDecompressedSize;
+    BLVFace* Src = (BLVFace *)malloc(header.uDecompressedSize);
     pRawDLV = Src;
     if ( v155 <= Count )
     {
@@ -2204,7 +2204,7 @@
       }
       else
       {
-        auto _uSourceLen = malloc(v155);
+        void* _uSourceLen = malloc(v155);
         fread(_uSourceLen, v155, 1u, File);
         zlib::MemUnzip(Src, &Count, _uSourceLen, v155);
         free(_uSourceLen);
@@ -2231,7 +2231,7 @@
 
   for (uint i = 0; i < pMapOutlines->uNumOutlines; ++i)
   {
-    auto pVertex = pMapOutlines->pOutlines + i;
+    BLVMapOutline* pVertex = &pMapOutlines->pOutlines[i];
     if ((unsigned __int8)(1 << (7 - i % 8)) & _visible_outlines[i / 8])
       pVertex->uFlags |= 1;
   }
@@ -2239,8 +2239,8 @@
 
   for (uint i = 0; i < uNumFaces; ++i)
   {
-    auto pFace = pFaces + i;
-    auto pFaceExtra = pFaceExtras + pFace->uFaceExtraID;
+    BLVFace* pFace = &pFaces[i];
+    BLVFaceExtra* pFaceExtra = &pFaceExtras[pFace->uFaceExtraID];
 
     memcpy(&pFace->uAttributes, pData, 4);
     pData += 4;
@@ -2279,7 +2279,7 @@
 
   for (uint i = 0; i < uNumSpriteObjects; ++i)
   {
-    auto pItem = &pSpriteObjects[i];
+    SpriteObject* pItem = &pSpriteObjects[i];
  
     if (pItem->stru_24.uItemID && !(pItem->uAttributes & 0x0100))
     {
@@ -2321,30 +2321,30 @@
   //if (uNumDoors > 0)
   for (uint i = 0, j = 0; i < uNumDoors; ++i)
   {
-    auto pDoor = pDoors + i;
-
-    pDoor->pVertexIDs = ptr_0002B4_doors_ddata + j;
+    BLVDoor* pDoor = &pDoors[i];
+
+    pDoor->pVertexIDs = &ptr_0002B4_doors_ddata[j];
     j += pDoor->uNumVertices;
 
-    pDoor->pFaceIDs = ptr_0002B4_doors_ddata + j;
+    pDoor->pFaceIDs = &ptr_0002B4_doors_ddata[j];
     j += pDoor->uNumFaces;
 
-    pDoor->pSectorIDs = ptr_0002B4_doors_ddata + j;
+    pDoor->pSectorIDs = &ptr_0002B4_doors_ddata[j];
     j += pDoor->field_48;
 
-    pDoor->pDeltaUs = (short *)(ptr_0002B4_doors_ddata + j);
+    pDoor->pDeltaUs = (short *)(&ptr_0002B4_doors_ddata[j]);
     j += pDoor->uNumFaces;
 
-    pDoor->pDeltaVs = (short *)(ptr_0002B4_doors_ddata + j);
+    pDoor->pDeltaVs = (short *)(&ptr_0002B4_doors_ddata[j]);
     j += pDoor->uNumFaces;
 
-    pDoor->pXOffsets = ptr_0002B4_doors_ddata + j;
+    pDoor->pXOffsets = &ptr_0002B4_doors_ddata[j];
     j += pDoor->uNumOffsets;
 
-    pDoor->pYOffsets = ptr_0002B4_doors_ddata + j;
+    pDoor->pYOffsets = &ptr_0002B4_doors_ddata[j];
     j += pDoor->uNumOffsets;
 
-    pDoor->pZOffsets = ptr_0002B4_doors_ddata + j;
+    pDoor->pZOffsets = &ptr_0002B4_doors_ddata[j];
     j += pDoor->uNumOffsets;
     /*v173 = pDoors;
     for ( k = 0; ; v172 = v188 + 2 * *((short *)&v173[k] - 3) )
@@ -2383,12 +2383,12 @@
   //v245 = 0;
   for (uint i = 0; i < uNumDoors; ++i)
   {
-    auto pDoor = pDoors + i;
+    BLVDoor* pDoor = &pDoors[i];
 
     for (uint j = 0; j < pDoor->uNumFaces; ++j)
     {
-      auto pFace = pFaces + pDoor->pFaceIDs[j];
-      auto pFaceExtra = pFaceExtras + pFace->uFaceExtraID;
+      BLVFace* pFace = &pFaces[pDoor->pFaceIDs[j]];
+      BLVFaceExtra* pFaceExtra = &pFaceExtras[pFace->uFaceExtraID];
 
       pDoor->pDeltaUs[j] = pFaceExtra->sTextureDeltaU;
       pDoor->pDeltaVs[j] = pFaceExtra->sTextureDeltaV;
@@ -2511,7 +2511,7 @@
 
   for (uint i = 1; i < uNumSectors; ++i)
   {
-    auto pSector = pSectors + i;
+    BLVSector* pSector = &pSectors[i];
 
     if (pSector->pBounding.x1 > sX || pSector->pBounding.x2 < sX ||
         pSector->pBounding.y1 > sY || pSector->pBounding.y2 < sY ||
@@ -2532,7 +2532,7 @@
       else
         uFaceID = pSector->pPortals[j - pSector->uNumFloors];
 
-      auto pFace = pFaces + uFaceID;
+      BLVFace* pFace = &pFaces[uFaceID];
       if (pFace->uPolygonType != POLYGON_Floor &&
           pFace->uPolygonType != POLYGON_InBetweenFloorAndWall)
         continue;
@@ -2547,13 +2547,13 @@
         if (v54 >= 2)
           break;
 
-        auto v2 = &pVertices[pFace->pVertexIDs[k]];
+        Vec3<int16_t>* v2 = &pVertices[pFace->pVertexIDs[k]];
         v50 = v2->y >= sY;
 
         if (v59 == v50)
           continue;
 
-        auto v1 = &pVertices[pFace->pVertexIDs[k - 1]];
+        Vec3<int16_t>* v1 = &pVertices[pFace->pVertexIDs[k - 1]];
         v25 = v2->x >= sX ? 0 : 2;
         v26 = v25 | (v1->x < sX);
 
@@ -2575,15 +2575,15 @@
                         //fixpoint_div(v1->x - v2->x, v1->y - v2->y);
                         //_a58 = v33 / (v1->y - v2->y);
                         //_a59 = fixpoint_mul(_a58, sY - v2->y);
-            auto x_div_y = fixpoint_div(v1->x - v2->x, v1->y - v2->y);
-            auto res = fixpoint_mul(x_div_y, sY - v2->y);  // a / b * c  - looks like projection 
+            long long x_div_y = fixpoint_div(v1->x - v2->x, v1->y - v2->y);
+            long long res = fixpoint_mul(x_div_y, sY - v2->y);  // a / b * c  - looks like projection 
             if (res + v2->x > sX)
               ++v54;
           }
           else
           {
-            auto x_div_y = fixpoint_div(v2->x - v1->x, v2->y - v1->y);
-            auto res = fixpoint_mul(x_div_y, sY - v1->y);
+            long long x_div_y = fixpoint_div(v2->x - v1->x, v2->y - v1->y);
+            long long res = fixpoint_mul(x_div_y, sY - v1->y);
 
             if (res + v1->x > sX)
               ++v54;
@@ -2854,7 +2854,7 @@
   //if ( pIndoor->uNumDoors > 0 )
   for (uint i = 0; i < pIndoor->uNumDoors; ++i)
   {
-    auto door = pIndoor->pDoors + i;
+    BLVDoor* door = &pIndoor->pDoors[i];
     //v80 = 0;
     //do
     //{
@@ -2897,7 +2897,7 @@
       }
       else
       {
-        auto v5 = (signed int)(door->uTimeSinceTriggered * door->uOpenSpeed) / 128;
+        signed int v5 = (signed int)(door->uTimeSinceTriggered * door->uOpenSpeed) / 128;
         //v6 = door->uMoveLength;
         if ( v5 >= door->uMoveLength)
         {
@@ -3274,12 +3274,12 @@
       if ( v0->uCurrentActionAnimation == ANIM_Walking)
       {
         v6 = v0->uMovementSpeed;
-        v7 = HIDWORD(v0->pActorBuffs[7].uExpireTime) == 0;
-        v8 = SHIDWORD(v0->pActorBuffs[7].uExpireTime) < 0;
+        v7 = HIDWORD(v0->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime) == 0;
+        v8 = SHIDWORD(v0->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime) < 0;
         v61 = v0->uMovementSpeed;
-        if ( !v8 && (!(v8 | v7) || LODWORD(v0->pActorBuffs[7].uExpireTime)) )
+        if ( !v8 && (!(v8 | v7) || LODWORD(v0->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime)) )
         {
-          v9 = v0->pActorBuffs[7].uPower;
+          v9 = v0->pActorBuffs[ACTOR_BUFF_SLOWED].uPower;
           if ( v9 )
             LODWORD(v10) = v6 / (unsigned __int16)v9;
           else
@@ -3755,7 +3755,7 @@
 
   for (uint i = 0; i < pIndoor->uNumDoors; ++i)
   {
-    auto pDoor = pIndoor->pDoors + i;
+    BLVDoor* pDoor = &pIndoor->pDoors[i];
 
     if (pDoor->uAttributes & 0x01)
     {
@@ -3817,7 +3817,7 @@
 
   for (uint i = 0; i < pIndoor->uNumFaces; ++i)
   {
-    auto pFace = pIndoor->pFaces + i;
+    BLVFace* pFace = &pIndoor->pFaces[i];
     if (!pFace->uBitmapID != -1)
       pBitmaps_LOD->pTextures[pFace->uBitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[pFace->uBitmapID].palette_id1);
  }
@@ -3826,7 +3826,7 @@
   
   for (uint i = 0; i < uNumLevelDecorations; ++i)
   {
-    auto pDecortaion = &pLevelDecorations[i];
+    LevelDecoration* pDecortaion = &pLevelDecorations[i];
     
     pDecorationList->InitializeDecorationSprite(pDecortaion->uDecorationDescID);
 
@@ -3888,10 +3888,10 @@
 
   for (uint i = 0; i < uNumSpriteObjects; ++i)
   {
-    auto p = &pSpriteObjects[i];
+    SpriteObject* p = &pSpriteObjects[i];
     if (p->uObjectDescID)
     {
-      auto uItemID = p->stru_24.uItemID;
+      int uItemID = p->stru_24.uItemID;
       if (uItemID)
       {
         if (uItemID != 220 && pItemsTable->pItems[uItemID].uEquipType == EQUIP_POTION &&
@@ -4024,11 +4024,11 @@
   static __int16 word_721390_ys[104]; // idb
   static __int16 word_721460_xs[104]; // idb
 
-  auto pSector = &pIndoor->pSectors[uSectorID];
+  BLVSector* pSector = &pIndoor->pSectors[uSectorID];
   v55 = 0;
   for (uint i = 0; i < pSector->uNumFloors; ++i)
   {
-    auto pFloor = &pIndoor->pFaces[pSector->pFloors[i]];
+    BLVFace* pFloor = &pIndoor->pFaces[pSector->pFloors[i]];
     if (pFloor->Clickable())
       continue;
 
@@ -4070,8 +4070,8 @@
             ++v53;
           else
           {
-            auto a_div_b = fixpoint_div(y - word_721390_ys[j], word_721390_ys[j + 1] - word_721390_ys[j]);
-            auto res = fixpoint_mul((signed int)word_721460_xs[j + 1] - (signed int)word_721460_xs[j], a_div_b);
+            long long a_div_b = fixpoint_div(y - word_721390_ys[j], word_721390_ys[j + 1] - word_721390_ys[j]);
+            long long res = fixpoint_mul((signed int)word_721460_xs[j + 1] - (signed int)word_721460_xs[j], a_div_b);
 
             if (res + word_721460_xs[j] >= x)
                 ++v53;
@@ -4103,7 +4103,7 @@
   {
     for (uint i = 0; i < pSector->uNumPortals; ++i)
     {
-      auto portal = &pIndoor->pFaces[pSector->pPortals[i]];
+      BLVFace* portal = &pIndoor->pFaces[pSector->pPortals[i]];
       if (portal->uPolygonType != POLYGON_Floor)
         continue;
 
@@ -4141,8 +4141,8 @@
                   ++v54;
                 else
                 {
-                  auto a_div_b = fixpoint_div(y - word_721390_ys[j], word_721390_ys[j + 1] - word_721390_ys[j]);
-                  auto res = fixpoint_mul(word_721460_xs[j + 1] - word_721460_xs[j], a_div_b);
+                  long long a_div_b = fixpoint_div(y - word_721390_ys[j], word_721390_ys[j + 1] - word_721390_ys[j]);
+                  long long res = fixpoint_mul(word_721460_xs[j + 1] - word_721460_xs[j], a_div_b);
                   if (res + word_721460_xs[j] >= x)
                     ++v54;
                 }
@@ -4506,7 +4506,7 @@
 
   for (uint i = 0; i < uNumActors; ++i)
   {
-    auto p = &pActors[i];
+    Actor* p = &pActors[i];
 
     if (p->uAIState == Removed ||
         p->uAIState == Disabled)
@@ -4541,7 +4541,7 @@
     }
     v8 = p->uCurrentActionTime;
 LABEL_12:
-    if (p->pActorBuffs[5].uExpireTime > 0i64 || p->pActorBuffs[6].uExpireTime > 0i64 )
+    if (p->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime > 0i64 || p->pActorBuffs[ACTOR_BUFF_PARALYZED].uExpireTime > 0i64 )
       v8 = 0;
     v31 = p->pSpriteIDs[v5];
     if (p->uAIState == Resurrected)
@@ -4620,9 +4620,9 @@
       a5a = (unsigned __int64)(v10->scale * (signed __int64)v19) >> 16;
     }
     v0->_screenspace_y_scaler_packedfloat = a5a;
-    if ( (signed __int64)p->pActorBuffs[3].uExpireTime <= 0 )
+    if ( (signed __int64)p->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime <= 0 )
     {
-      if ( (signed __int64)p->pActorBuffs[10].uExpireTime > 0 )
+      if ( (signed __int64)p->pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].uExpireTime > 0 )
       {
         a5b = (unsigned __int64)(pGame->pStru6Instance->_4A806F(p) * (signed __int64)v0->_screenspace_y_scaler_packedfloat) >> 16;
         goto LABEL_43;
@@ -4630,11 +4630,11 @@
     }
     else
     {
-      v22 = p->pActorBuffs[3].uPower;
+      v22 = p->pActorBuffs[ACTOR_BUFF_SHRINK].uPower;
       if ( v22 )
       {
         v23 = (unsigned __int64)(65536 / (unsigned __int16)v22 * (signed __int64)v0->_screenspace_x_scaler_packedfloat) >> 16;
-        v24 = p->pActorBuffs[3].uPower;
+        v24 = p->pActorBuffs[ACTOR_BUFF_SHRINK].uPower;
         v0->_screenspace_x_scaler_packedfloat = v23;
         a5b = (unsigned __int64)(65536 / v24 * (signed __int64)v0->_screenspace_y_scaler_packedfloat) >> 16;
 LABEL_43:
@@ -4656,12 +4656,12 @@
     v0->actual_z = HIWORD(x);
     v0->object_pid = PID(OBJECT_Actor,i);
 
-    v29 = HIDWORD(p->pActorBuffs[5].uExpireTime) == 0;
-    v30 = HIDWORD(p->pActorBuffs[5].uExpireTime) < 0;
+    v29 = HIDWORD(p->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime) == 0;
+    v30 = HIDWORD(p->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime) < 0;
     v0->field_1E = v41;
     v0->pSpriteFrame = v10;
     v0->uTintColor = pMonsterList->pMonsters[p->pMonsterInfo.uID - 1].uTintColor;
-    if ( !v30 && (!(v30 | v29) || LODWORD(p->pActorBuffs[5].uExpireTime)) )
+    if ( !v30 && (!(v30 | v29) || LODWORD(p->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime)) )
     {
       HIBYTE(v26) = HIBYTE(v41) | 1;
       v0->field_1E = v26;
@@ -4709,7 +4709,7 @@
 
   for (uint i = 0; i < uNumSpriteObjects; ++i)
   {
-    auto p = &pSpriteObjects[i];
+    SpriteObject* p = &pSpriteObjects[i];
     if (p->uObjectDescID)
     {
       v1 = &pObjectList->pObjects[p->uObjectDescID];
@@ -6090,7 +6090,7 @@
         return 1;
       if ( v14 == 5 )
       {
-        stru_50C198.LootActor(&pActors[PID_ID(a1)]);
+        pActors[PID_ID(a1)].LootActor();
       }
       else
       {
@@ -6151,7 +6151,7 @@
             face_id = PID_ID(a1) & 0x3F;
         if (bmodel_id >= pOutdoor->uNumBModels)
           return 1;
-        auto face = &pOutdoor->pBModels[bmodel_id].pFaces[face_id];
+        ODMFace* face = &pOutdoor->pBModels[bmodel_id].pFaces[face_id];
         if (face->uAttributes & 0x100000 || face->sCogTriggeredID == 0 )
           return 1;
         EventProcessor((signed __int16)face->sCogTriggeredID, v2, 1);
--- a/IndoorCameraD3D.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/IndoorCameraD3D.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -429,7 +429,7 @@
   {
     //ViewTransform_ODM(a1a + i);
 
-    auto a1 = a1a + i;
+    RenderVertexSoft* a1 = &a1a[i];
     //----- (00481CCE) --------------------------------------------------------
     //void ViewTransform_ODM(RenderVertexSoft *a1)
     {
--- a/Items.h	Fri Nov 01 14:43:54 2013 +0600
+++ b/Items.h	Fri Nov 01 14:44:06 2013 +0600
@@ -10,10 +10,11 @@
     DMGT_COLD   = 2,
     DMGT_EARTH      = 3,
     DMGT_PHISYCAL= 4,
-    DMGT_5      = 5,
+    DMGT_MAGICAL = 5,
     DMGT_SPIRIT = 6,
     DMGT_MIND   = 7,
     DMGT_BODY   = 8,
+    DMGT_LIGHT  = 9,
     DMGT_DARK   =10
     };
 
--- a/Keyboard.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Keyboard.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -990,7 +990,7 @@
   if ( pRenderer->pRenderD3D )
   {
     pGame->PickKeyboard(GetAsyncKeyState(VK_CONTROL) & 0x8001, &vis_sprite_filter_3, &vis_door_filter);
-    auto pid = pGame->pVisInstance->get_picked_object_zbuf_val();
+    int pid = pGame->pVisInstance->get_picked_object_zbuf_val();
     if ( pid != -1 )
       DoInteractionWithTopmostZObject(pid & 0xFFFF, PID_ID(pid));
     return;
--- a/LOD.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/LOD.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -1515,7 +1515,7 @@
 
     //insert new data in sorted index lod file
     bRewrite_data = false;
-    insert_index=0;
+    insert_index=-1;
     if (!isFileOpened)
         return 1;
     if ( !pSubIndices)
@@ -1551,8 +1551,11 @@
                 }
             else if (comp_res>0)
                 {
-                if (insert_index==0)
+                if (insert_index==-1)
+                  {
                      insert_index=i;
+                     break;
+                  }
                 }
             }
     strcpy(Filename, "lod.tmp");
@@ -2571,7 +2574,7 @@
   //v5 = this;
   //v6 = FindContainer(pContainer, 0);
   //File = v6;
-  auto pFile = FindContainer(pContainer, false);
+  FILE* pFile = FindContainer(pContainer, false);
   if (!pFile)
     return -1;
   v8 = pOutTex;
--- a/LightmapBuilder.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/LightmapBuilder.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -566,8 +566,8 @@
 //----- (0045C7F6) --------------------------------------------------------
 bool LightmapBuilder::ApplyLights_IndoorFace(unsigned int uFaceID)
 {
-  auto pFace = &pIndoor->pFaces[uFaceID];
-  auto pSector = pIndoor->pSectors + pFace->uSectorID;
+  BLVFace* pFace = &pIndoor->pFaces[uFaceID];
+  BLVSector* pSector = &pIndoor->pSectors[pFace->uSectorID];
 
   stru_F8AD28.uCurrentAmbientLightLevel = (stru_F8AD28.uDefaultAmbientLightLevel + pSector->uMinAmbientLightLevel) << 16;
 
@@ -585,7 +585,7 @@
     if (uNumLightsApplied >= 20 )
       break;
 
-    auto pLight = &pIndoor->pLights[pSector->pLights[i]];
+    BLVLightMM7* pLight = &pIndoor->pLights[pSector->pLights[i]];
     if (~pLight->uAtributes & 0x08)
       ApplyLight_BLV((StationaryLight *)pLight, pFace, &uFaceID, false, &byte_4E94D0);
   }
@@ -623,7 +623,7 @@
           a2->pFacePlane.dist;
     if ((bLightBackfaces || v13 >= 0.0f) && fabsf(v13) <= pLight->uRadius)
     {
-      auto slot = *pSlot;
+      unsigned int slot = *pSlot;
 
       stru_F8AD28._blv_lights_radii[slot] = pLight->uRadius;
       stru_F8AD28._blv_lights_inv_radii[slot] = 65536 / pLight->uRadius;
@@ -1432,7 +1432,7 @@
       arg4.z = 1.0f;
       if (indices)
       {
-        for (auto i = indices; *i != -1; ++i)
+        for (int* i = indices; *i != -1; ++i)
         {
           v28 = &std__vector_000004[*i];
           if ( !DrawLightmap(v28, &arg4, 0.0) )
@@ -1441,9 +1441,9 @@
       }
       else
       {
-        for (auto i = 0; i < std__vector_000004_size; ++i)
+        for (unsigned int i = 0; i < std__vector_000004_size; ++i)
         {
-            auto _a1 = &std__vector_000004[(int)i];
+            Lightmap* _a1 = &std__vector_000004[(int)i];
             if ( !DrawLightmap(_a1, &arg4, 0.0) )
             {
               MessageBoxW(nullptr, L"Invalid lightmap detected!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Light.cpp:1238", 0);
@@ -1576,7 +1576,7 @@
   ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE));
   ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE));
 
-  auto pTex = pGame->pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("effpar03");
+  IDirect3DTexture2* pTex = pGame->pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("effpar03");
   ErrD3D(pRenderer->pRenderD3D->pDevice->SetTexture(0, pTex));
 
   ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE));
--- a/Lights.h	Fri Nov 01 14:43:54 2013 +0600
+++ b/Lights.h	Fri Nov 01 14:44:06 2013 +0600
@@ -84,7 +84,7 @@
       return false;
     }
 
-      auto pLight = &pLights[uNumLightsActive++];
+      StationaryLight* pLight = &pLights[uNumLightsActive++];
       pLight->vPosition.x = x;
       pLight->vPosition.y = y;
       pLight->vPosition.z = z;
--- a/Monsters.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Monsters.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -472,7 +472,7 @@
   for (uint i = 0; i < num_mm6_monsters; ++i)
   {
     auto src = (MonsterDesc_mm6 *)((char *)data_mm6 + 4) + i;
-    auto dst = pMonsters + num_mm7_monsters + i;
+    MonsterDesc* dst = &pMonsters[num_mm7_monsters + i];
 
     dst->uMonsterHeight = src->uMonsterHeight;
     dst->uMonsterRadius = src->uMonsterRadius;
--- a/Mouse.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Mouse.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -180,7 +180,7 @@
 //----- (00469C0D) --------------------------------------------------------
 void *Mouse::DoAllocCursorMem()
 {
-  auto tex = pIcons_LOD->GetTexture(uCursorTextureID);
+  Texture* tex = pIcons_LOD->GetTexture(uCursorTextureID);
   return malloc(4 * tex->uTextureWidth * tex->uTextureHeight);
 }
 
@@ -329,7 +329,7 @@
   if (!pCursorBitmap3_sysmembits_16bit)
     return;
 
-  auto pSrc = pCursorBitmap3_sysmembits_16bit;
+  ushort* pSrc = pCursorBitmap3_sysmembits_16bit;
   for (uint y = field_44; y < field_4C; ++y)
     for (uint x = field_40; x < field_48; ++x)
       pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + x] = *pSrc++;
@@ -583,7 +583,7 @@
     v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
   v6 = (unsigned __int16)v5;
 
-  auto type = PID_TYPE(v6);
+  uint type = PID_TYPE(v6);
   if (type == OBJECT_Actor
     && uActiveCharacter
     && v5 < 0x2000000
--- a/NewUI/MainMenu.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/NewUI/MainMenu.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -28,14 +28,14 @@
 
 bool MainMenuWindow::Initialize()
 {
-  auto background_texture = new RGBTexture;
+  RGBTexture* background_texture = new RGBTexture;
   background_texture->Load("mm6title.pcx", 0);
   return true;
 }
 
 MainMenuWindow *MainMenuWindow::Create()
 {
-  auto window = new MainMenuWindow;
+  MainMenuWindow* window = new MainMenuWindow;
   if (window)
     if (!window->Initialize())
     {
--- a/OSWindow.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/OSWindow.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -430,7 +430,7 @@
 
 OSWindow *OSWindow::Create(const wchar_t *title, int window_width, int window_height)
 {
-  auto window = new OSWindow;
+  OSWindow* window = new OSWindow;
   if (window)
     if (!window->Initialize(title, window_width, window_height))
     {
@@ -447,14 +447,14 @@
 {
   if (msg == WM_NCCREATE)
   {
-    auto cs = (CREATESTRUCTA *)(lparam);
-    auto window = (OSWindow *)cs->lpCreateParams;
+    CREATESTRUCTA* cs = (CREATESTRUCTA *)(lparam);
+    OSWindow* window = (OSWindow *)cs->lpCreateParams;
 
     SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)window);
     return DefWindowProcW(hwnd, msg, wparam, lparam);
   }
 
-  auto window = (OSWindow *)GetWindowLongPtrW(hwnd, GWLP_USERDATA);
+  OSWindow* window = (OSWindow *)GetWindowLongPtrW(hwnd, GWLP_USERDATA);
   if (window && window->api_handle == hwnd)
   {
     LPARAM result;
--- a/ObjectList.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/ObjectList.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -71,7 +71,7 @@
   for (uint i = 0; i < num_mm6_objs; ++i)
   {
     auto src = (ObjectDesc_mm6 *)((char *)data_mm6 + 4) + i;
-    auto dst = pObjects + num_mm7_objs + i;
+    ObjectDesc* dst = &pObjects[num_mm7_objs + i];
     memcpy(dst->field_0, src->field_0, sizeof(dst->field_0));
     dst->uObjectID = src->uObjectID;
     dst->uRadius = src->uRadius;
--- a/Outdoor.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Outdoor.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -394,7 +394,7 @@
   char Str[140]; // [sp+8h] [bp-78h]@3
   //int a5a; // [sp+94h] [bp+14h]@3
 
-  auto Source = this;
+  OutdoorLocation* Source = this;
 
   v5 = Source;
   if ( a5 < 10
@@ -626,7 +626,7 @@
 {
   strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
 
-  auto map_id = pMapStats->GetMapInfo(pCurrentMapName);
+  MAP_TYPE map_id = pMapStats->GetMapInfo(pCurrentMapName);
   if (map_id == MAP_INVALID || map_id == MAP_CELESTIA || map_id == MAP_THE_PIT || map_id > MAP_SHOALS)
     return;
 
@@ -1727,13 +1727,13 @@
   //v40 = header.uCompressedSize;
   //pSource = header.uDecompressedSize;
   //v41 = malloc(header.uDecompressedSize);
-  auto pSrcMem = (unsigned char *)malloc(header.uDecompressedSize);
-  auto pSrc = pSrcMem;
+  uchar* pSrcMem = (unsigned char *)malloc(header.uDecompressedSize);
+  uchar* pSrc = pSrcMem;
   //v42 = v41;
   //HIDWORD(v142) = (uint32)pSrc;
   if (header.uCompressedSize < header.uDecompressedSize)
   {
-    auto pComressedSrc = (char *)malloc(header.uCompressedSize);
+    char* pComressedSrc = (char *)malloc(header.uCompressedSize);
     fread(pComressedSrc, header.uCompressedSize, 1, v39);
 
     uint actualDecompressedSize = header.uDecompressedSize;
@@ -1824,7 +1824,7 @@
   for (uint i = 0; i < uNumBModels; ++i)
   {
     //v48 = 0;
-    auto model = &pBModels[i];
+    BSPModel* model = &pBModels[i];
 
     model->pVertices.pVertices = nullptr;
     model->pFaces = nullptr;
@@ -1895,7 +1895,7 @@
       //memcpy(v59, uSourceLen, (size_t)pFilename);
       //uSourceLen = (char *)uSourceLen + (int)pFilename;
     //ptr = (FILE *)malloc(10 * model->uNumFaces);
-    auto textureFilenames = (const char *)malloc(10 * model->uNumFaces);
+    const char* textureFilenames = (const char *)malloc(10 * model->uNumFaces);
       //pFilename = (char *)(10 * pBModels[v48].uNumFaces);
     memcpy((char *)textureFilenames, pSrc, 10 * model->uNumFaces);
     pSrc += 10 * model->uNumFaces;
@@ -1904,11 +1904,11 @@
       //v60 = pBModels;
     for (uint j = 0; j < model->uNumFaces; ++j)
     {
-      auto texFilename = textureFilenames + j * 10;
+      const char* texFilename = &textureFilenames[j * 10];
     //v149 = 0;
     //Str2 = (char *)ptr;
 
-      auto *face = &model->pFaces[j];
+      ODMFace* face = &model->pFaces[j];
       //pFilename = (char *)v149 + (unsigned int)v60[v48].pFaces;
       if (~face->uAttributes & FACE_DONT_CACHE_TEXTURE)
       {
@@ -2073,7 +2073,7 @@
       fread(pSrc, header.uDecompressedSize, 1u, v39);
     else if (header.uCompressedSize < header.uDecompressedSize)
     {
-      auto compressedMem = malloc(header.uCompressedSize);
+      void* compressedMem = malloc(header.uCompressedSize);
       fread(compressedMem, header.uCompressedSize, 1, v39);
 
       uint actualDecompressedSize = header.uDecompressedSize;
@@ -2143,7 +2143,7 @@
       fread(pSrcMem, header.uDecompressedSize, 1, v39);
     else if (header.uCompressedSize < header.uDecompressedSize)
     {
-      auto compressedMem = malloc(header.uCompressedSize);
+      void* compressedMem = malloc(header.uCompressedSize);
       fread(compressedMem, header.uCompressedSize, 1u, v39);
 
       uint actualDecompressedSize = header.uDecompressedSize;
@@ -2181,7 +2181,7 @@
   //v151 = 0;
   for (uint i = 0; i < uNumBModels; ++i)
   {
-    auto model = pBModels[i];
+    BSPModel model = pBModels[i];
     //pNumItems = 0;
     //do
     //{
@@ -2190,7 +2190,7 @@
       //v87 = (unsigned int)((char *)v86 + pNumItems);
     for (uint j = 0; j < model.uNumFaces; ++j)
     {
-      auto face = model.pFaces[j];
+      ODMFace face = model.pFaces[j];
 
       //if ( *(int *)(v87 + 76) > 0 )
       //{
@@ -2213,7 +2213,7 @@
       //thisa = 0;
     for (uint j = 0; j < model.uNumFaces; ++j)
     {
-      auto face = model.pFaces[j];
+      ODMFace face = model.pFaces[j];
         //pFilename = 0;
         //do
         //{
@@ -2321,7 +2321,7 @@
   strcpy(pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture.data());
   //v97 = pTileTypes[0].uTileID;
   //v108 = 0;
-  auto v98 = pTileTable->GetTileById(pTileTypes[0].uTileID);
+  TileDesc* v98 = pTileTable->GetTileById(pTileTypes[0].uTileID);
   //v99 = pBitmaps_LOD->LoadTexture(v98->pTileName, TEXTURE_DEFAULT);
   uMainTile_BitmapID = pBitmaps_LOD->LoadTexture(v98->pTileName, TEXTURE_DEFAULT);
   if (uMainTile_BitmapID != -1)
@@ -2681,7 +2681,7 @@
 
   for (uint i = 0; i < uNumLevelDecorations; ++i)
   {
-    auto decor = &pLevelDecorations[i];
+    LevelDecoration* decor = &pLevelDecorations[i];
 
       pDecorationList->InitializeDecorationSprite(decor->uDecorationDescID);
       v4 = pDecorationList->pDecorations[decor->uDecorationDescID].uSoundID;
@@ -2916,7 +2916,7 @@
     //v1 = pActors;//[0].vPosition.z;
     //do
     //{
-    auto actor = &pActors[i];
+    Actor* actor = &pActors[i];
 	  //v2 = actor->uAIState;
 
 	actor->uAttributes &= 0xFFFFFFF7u;
@@ -2968,7 +2968,7 @@
       }
       v12 = 32 * i + v11;
 LABEL_18:
-      if ( (signed __int64)actor->pActorBuffs[5].uExpireTime > 0 || (signed __int64)actor->pActorBuffs[6].uExpireTime > 0 )
+      if ( (signed __int64)actor->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime > 0 || (signed __int64)actor->pActorBuffs[ACTOR_BUFF_PARALYZED].uExpireTime > 0 )
         v12 = 0;
 	  v13 = actor->uAIState;
       if ( v13 == 17 && !v49 )
@@ -3062,12 +3062,12 @@
         v28->uIndoorSectorID = 0;
         v28->uPalette = v15->uPaletteIndex;
         v28->_screenspace_x_scaler_packedfloat = (unsigned __int64)(v15->scale * (signed __int64)v58) >> 16;
-        v30 = HIDWORD(actor->pActorBuffs[3].uExpireTime) == 0;
-        v31 = SHIDWORD(actor->pActorBuffs[3].uExpireTime) < 0;
+        v30 = HIDWORD(actor->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime) == 0;
+        v31 = SHIDWORD(actor->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime) < 0;
         v28->_screenspace_y_scaler_packedfloat = (unsigned __int64)(v15->scale * (signed __int64)v57) >> 16;
-        if ( v31 || v31 | v30 && LODWORD(actor->pActorBuffs[3].uExpireTime) <= 0u )
+        if ( v31 || v31 | v30 && LODWORD(actor->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime) <= 0u )
         {
-          if ( (signed __int64)actor->pActorBuffs[10].uExpireTime > 0i64 )
+          if ( (signed __int64)actor->pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].uExpireTime > 0i64 )
           {
             v52 = (unsigned __int64)(pGame->pStru6Instance->_4A806F(actor)
                                    * (signed __int64)v28->_screenspace_y_scaler_packedfloat) >> 16;
@@ -3078,10 +3078,10 @@
         }
         else
         {
-          v32 = actor->pActorBuffs[3].uPower;
+          v32 = actor->pActorBuffs[ACTOR_BUFF_SHRINK].uPower;
           if ( v32 )
           {
-            v33 = actor->pActorBuffs[3].uPower;
+            v33 = actor->pActorBuffs[ACTOR_BUFF_SHRINK].uPower;
             v28->_screenspace_x_scaler_packedfloat = (unsigned __int64)(65536 / (unsigned __int16)v32 * (signed __int64)v28->_screenspace_x_scaler_packedfloat) >> 16;
             v52 = (unsigned __int64)(65536 / v33 * (signed __int64)v28->_screenspace_y_scaler_packedfloat) >> 16;
             goto LABEL_53;
@@ -3313,23 +3313,23 @@
 //----- (0046DCC8) --------------------------------------------------------
 void ODM_GetTerrainNormalAt(int pos_x, int pos_z, Vec3_int_ *out)
 {
-  auto grid_x = WorldPosToGridCellX(pos_x);
-  auto grid_z = WorldPosToGridCellZ(pos_z) - 1;
+  uint grid_x = WorldPosToGridCellX(pos_x);
+  uint grid_z = WorldPosToGridCellZ(pos_z) - 1;
 
-  auto grid_pos_x1 = GridCellToWorldPosX(grid_x);
-  auto grid_pos_x2 = GridCellToWorldPosX(grid_x + 1);
-  auto grid_pos_z1 = GridCellToWorldPosZ(grid_z);
-  auto grid_pos_z2 = GridCellToWorldPosZ(grid_z + 1);
+  int grid_pos_x1 = GridCellToWorldPosX(grid_x);
+  int grid_pos_x2 = GridCellToWorldPosX(grid_x + 1);
+  int grid_pos_z1 = GridCellToWorldPosZ(grid_z);
+  int grid_pos_z2 = GridCellToWorldPosZ(grid_z + 1);
 
-  auto x1z1_y = pOutdoor->DoGetHeightOnTerrain(grid_x, grid_z);
-  auto x2z1_y = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z);
-  auto x2z2_y = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z + 1);
-  auto x1z2_y = pOutdoor->DoGetHeightOnTerrain(grid_x, grid_z + 1);
+  int x1z1_y = pOutdoor->DoGetHeightOnTerrain(grid_x, grid_z);
+  int x2z1_y = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z);
+  int x2z2_y = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z + 1);
+  int x1z2_y = pOutdoor->DoGetHeightOnTerrain(grid_x, grid_z + 1);
 
   float side1_dx, side1_dy, side1_dz,
         side2_dx, side2_dy, side2_dz;
 
-  auto dx = abs(pos_x - grid_pos_x1),
+  int dx = abs(pos_x - grid_pos_x1),
        dz = abs(grid_pos_z1 - pos_z);
   if (dz >= dx)
   {
@@ -3400,7 +3400,7 @@
   ai_arrays_size = 0;
   for (uint i = 0; i < uNumActors; ++i)
   {
-    auto actor = &pActors[i];
+    Actor* actor = &pActors[i];
 
     actor->uAttributes &= 0xFFFFFBFF;
     if (!actor->CanAct())
--- a/ParticleEngine.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/ParticleEngine.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -177,7 +177,7 @@
 
   for (uint i = uStartParticle; i <= uEndParticle; ++i)
   {
-    auto p = pParticles + i;
+    Particle* p = &pParticles[i];
 
       if (p->type == ParticleType_Invalid)
         continue;
@@ -531,7 +531,7 @@
         //HIDWORD(v8) = fixpoint_sub_unknown(v6->x - pIndoorCamera->pos.x, v5);
         //v12 = v6->_z + 6.7553994e15;
         //uIDd = (LODWORD(v12) - pIndoorCamera->pos.z) << 16;
-        auto _hidword_v12 = fixpoint_mul(v11, v3) + fixpoint_sub_unknown(v6->z - pGame->pIndoorCameraD3D->vPartyPos.z, v44);
+        long long _hidword_v12 = fixpoint_mul(v11, v3) + fixpoint_sub_unknown(v6->z - pGame->pIndoorCameraD3D->vPartyPos.z, v44);
         LODWORD(v13) = 0;
         HIDWORD(v13) = SLOWORD(pODMRenderParams->int_fov_rad);
         //v14 = v13 / _hidword_v12;
@@ -569,7 +569,7 @@
         //v21 = v6->_z + 6.7553994e15;
         LODWORD(v22) = 0;
         HIDWORD(v22) = SLOWORD(pODMRenderParams->int_fov_rad);
-        auto _var_123 = fixpoint_sub_unknown(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_sub_unknown(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v5);
+        long long _var_123 = fixpoint_sub_unknown(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_sub_unknown(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v5);
         //v23 = v22 / _var_123;
         v6->_screenspace_scale = v22 / _var_123;
         //v24 = v6->_screenspace_scale;
@@ -636,7 +636,7 @@
 
   for (uint i = uStartParticle; i < uEndParticle; ++i)
   {
-    auto p = pParticles + i;
+    Particle* p = &pParticles[i];
 
     if (p->type == ParticleType_Invalid)
       continue;
@@ -755,7 +755,7 @@
   //v16 = this->uStartParticle;
   for (uint i = uStartParticle; i <= uEndParticle; ++i)
   {
-    auto particle = pParticles + i;
+    Particle* particle = &pParticles[i];
     if (particle->type == ParticleType_Invalid || !ViewProject_TrueIfStillVisible_ODM(i))
       continue;
 
--- a/Party.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Party.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -45,7 +45,7 @@
 
   for (unsigned int i = 0; i < pNPCStats->uNumNewNPCs; ++i)
   {
-    auto npc = pNPCStats->pNewNPCData + i;
+    NPCData* npc = &pNPCStats->pNewNPCData[i];
     if (npc->Hired() &&
         (!pHirelings[0].pName || strcmp(npc->pName, pHirelings[0].pName)))
     {
@@ -621,14 +621,14 @@
   this->field_708 = 15;
   this->field_0 = 25;
 
-  for (auto playerId = 0; playerId < 4; playerId++)
+  for (int playerId = 0; playerId < 4; playerId++)
   {
-    for (auto buffId = 0; buffId < 24; buffId++)
+    for (int buffId = 0; buffId < 24; buffId++)
     {
       this->pPlayers[playerId].pPlayerBuffs[buffId].Reset();
     }
   }
-  for (auto buffId = 0; buffId < 20; buffId++)
+  for (int buffId = 0; buffId < 20; buffId++)
   {
     this->pPartyBuffs[buffId].Reset();
   }
@@ -644,7 +644,7 @@
     Player* player = &pPlayers[i];
     player->uExpressionTimePassed += (unsigned short)pMiscTimer->uTimeElapsed;
 
-    auto condition = player->GetMajorConditionIdx();
+    uint condition = player->GetMajorConditionIdx();
     if (condition == Condition_Good || condition == Condition_Zombie)
     {
       if (player->uExpressionTimePassed < player->uExpressionTimeLength)
--- a/Player.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Player.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -1470,7 +1470,7 @@
       break;
   }
 
-  auto uConditionMult = pConditionAttributeModifier[attrId][GetMajorConditionIdx()];
+  uchar uConditionMult = pConditionAttributeModifier[attrId][GetMajorConditionIdx()];
   int magicBonus = GetMagicalBonus(attrId);
   int itemBonus = GetItemsBonus(attrId);
   return uConditionMult * uAgeingMultiplier * this->*attrValue / 100 / 100
@@ -1915,7 +1915,7 @@
 //----- (0048D6AA) --------------------------------------------------------
 bool Player::HasItemEquipped(ITEM_EQUIP_TYPE uEquipIndex)
 {
-  auto i = pEquipment.pIndices[uEquipIndex];
+  uint i = pEquipment.pIndices[uEquipIndex];
   if (i)
     return !pOwnItems[i - 1].IsBroken();
   else 
@@ -2550,7 +2550,7 @@
   uint armour_recovery = 0;
   if ( HasItemEquipped(EQUIP_ARMOUR) )
   {
-    auto armour_skill_type = GetArmorItem()->GetPlayerSkillType();
+    uchar armour_skill_type = GetArmorItem()->GetPlayerSkillType();
     uint base_armour_recovery = base_recovery_times_per_weapon_type[armour_skill_type];
     float multiplier;
 
@@ -2578,7 +2578,7 @@
   uint shield_recovery = 0;
   if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD)
   {
-    auto skill_type = GetOffHandItem()->GetPlayerSkillType();
+    uchar skill_type = GetOffHandItem()->GetPlayerSkillType();
 
     uint shield_base_recovery = base_recovery_times_per_weapon_type[skill_type];
     float multiplier = GetArmorRecoveryMultiplierFromSkillLevel(skill_type, 1.0f, 0, 0, 0);
@@ -3578,30 +3578,36 @@
         if (currItem != nullptr && (!currItem->IsBroken()))
         {
           PLAYER_SKILL_TYPE itemSkillType = (PLAYER_SKILL_TYPE)currItem->GetPlayerSkillType();
-          int currArmorSkillLevel = GetActualSkillLevel(itemSkillType);
+          int currArmorSkillLevel = 0;
           int multiplier = 0;
           switch (itemSkillType)
           {
           case PLAYER_SKILL_STAFF:
+            currArmorSkillLevel = GetActualSkillLevel(itemSkillType);
             multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 0, 1, 1, 1);
             break;
           case PLAYER_SKILL_SWORD:
           case PLAYER_SKILL_SPEAR:
+            currArmorSkillLevel = GetActualSkillLevel(itemSkillType);
             multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 0, 0, 0, 1);
             break;
           case PLAYER_SKILL_SHIELD:
+            currArmorSkillLevel = GetActualSkillLevel(itemSkillType);
             wearingArmor = true;
             multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 2, 2);
             break;
           case PLAYER_SKILL_LEATHER:
+            currArmorSkillLevel = GetActualSkillLevel(itemSkillType);
             wearingLeather = true;
             multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 2, 2);
             break;
           case PLAYER_SKILL_CHAIN:
+            currArmorSkillLevel = GetActualSkillLevel(itemSkillType);
             wearingArmor = true;
             multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 1, 1);
             break;
           case PLAYER_SKILL_PLATE:
+            currArmorSkillLevel = GetActualSkillLevel(itemSkillType);
             wearingArmor = true; 
             multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 1, 1);
             break;
@@ -3843,7 +3849,7 @@
 //----- (00490188) --------------------------------------------------------
 void Player::SetInitialStats()
 {
-  auto v1 = GetRace();
+  CHARACTER_RACE v1 = GetRace();
   uMight = StatTable[v1][0].uBaseValue;
   uIntelligence = StatTable[v1][1].uBaseValue;
   uWillpower = StatTable[v1][2].uBaseValue;
@@ -7299,9 +7305,9 @@
     }
     pAudioPlayer->PlaySound(soundToPlay, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0);
     int dmgToReceive = actorPtr->_43B3E0_CalcDamage(dmgSource);
-    if ( actorPtr->pActorBuffs[3].uExpireTime > 0 )
+    if ( actorPtr->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime > 0 )
     {
-      __int16 spellPower = actorPtr->pActorBuffs[3].uPower;
+      __int16 spellPower = actorPtr->pActorBuffs[ACTOR_BUFF_SHRINK].uPower;
       if ( spellPower )
         dmgToReceive /= (signed int)spellPower;
     }
@@ -7486,9 +7492,9 @@
             dmgToReceive >>= 1;
         }
       }
-      if ( actorPtr->pActorBuffs[3].uExpireTime > 0 )
+      if ( actorPtr->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime > 0 )
       {
-        int spellPower = actorPtr->pActorBuffs[3].uPower;
+        int spellPower = actorPtr->pActorBuffs[ACTOR_BUFF_SHRINK].uPower;
         if ( spellPower )
           dmgToReceive /= (signed int)spellPower;
       }
--- a/Render.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Render.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -147,7 +147,7 @@
   pODMRenderParams->uNumBillboards = ::uNumBillboardsToDraw;
   for (uint i = 0; i < ::uNumBillboardsToDraw; ++i)
   {
-    auto p = pBillboardRenderList + i;
+    RenderBillboard* p = &pBillboardRenderList[i];
 
       soft_billboard.uScreenSpaceX = p->uScreenSpaceX;
       soft_billboard.uParentBillboardID = i;
@@ -299,7 +299,7 @@
       uint norm_idx = pTerrainNormalIndices[2 * (x * 128 + z) + 2];
       assert(norm_idx < uNumTerrainNormals);
 
-      auto norm = pTerrainNormals + norm_idx;
+      Vec3_float_* norm = &pTerrainNormals[norm_idx];
       float _f = ((norm->x * (float)pOutdoor->vSunlight.x / 65536.0) -
                   (norm->y * (float)pOutdoor->vSunlight.y / 65536.0) -
                   (norm->z * (float)pOutdoor->vSunlight.z / 65536.0));
@@ -390,7 +390,7 @@
 
   for (int i = 0; i < ::uNumBillboardsToDraw; ++i)
   {
-    auto pBillboard = pBillboardRenderList + i;
+    RenderBillboard* pBillboard = &pBillboardRenderList[i];
 
     billboard.uScreenSpaceX = pBillboard->uScreenSpaceX;
     billboard.uScreenSpaceY = pBillboard->uScreenSpaceY;
@@ -489,7 +489,7 @@
   //v41 = 0;
   for (int i = 0; i < uNumSpriteObjects; ++i)
   {
-    auto object = &pSpriteObjects[i];
+    SpriteObject* object = &pSpriteObjects[i];
     //auto v0 = (char *)&pSpriteObjects[i].uSectorID;
     //v0 = (char *)&pSpriteObjects[0].uSectorID;
     //do
@@ -498,7 +498,7 @@
       continue;
 
     assert(object->uObjectDescID < pObjectList->uNumObjects);
-    auto object_desc = pObjectList->pObjects + object->uObjectDescID;
+    ObjectDesc* object_desc = &pObjectList->pObjects[object->uObjectDescID];
     if (object_desc->NoSprite())
       continue;
 
@@ -908,13 +908,13 @@
     //do
   for (int i = 0; i < uNumLevelDecorations; ++i)
   {
-    auto decor = &pLevelDecorations[i];
-    auto v0 = (char *)&pLevelDecorations[i].vPosition.y;
+    LevelDecoration* decor = &pLevelDecorations[i];
+    char* v0 = (char *)&pLevelDecorations[i].vPosition.y;
 
     if ((!(decor->uFlags & LEVEL_DECORATION_OBELISK_CHEST) || decor->IsObeliskChestActive()) && !(decor->uFlags & LEVEL_DECORATION_INVISIBLE))
     {
       //v1 = &pDecorationList->pDecorations[decor->uDecorationDescID];
-      auto decor_desc = pDecorationList->pDecorations + decor->uDecorationDescID;
+      DecorationDesc* decor_desc = pDecorationList->pDecorations + decor->uDecorationDescID;
       v2 = decor_desc->uFlags;
       if ( (char)v2 >= 0 )
       {
@@ -2113,8 +2113,8 @@
 
   this->bTinting = bTinting;
 
-  auto r1 = pD3DBitmaps.Load(L"data\\d3dbitmap.hwl");
-  auto r2 = pD3DSprites.Load(L"data\\d3dsprite.hwl");
+  bool r1 = pD3DBitmaps.Load(L"data\\d3dbitmap.hwl");
+  bool r2 = pD3DSprites.Load(L"data\\d3dsprite.hwl");
 
   return r1 && r2;
 }
@@ -2949,7 +2949,7 @@
   IDirectDrawSurface4 *v4; // ST0C_4@6
   RECT v5; // [sp+8h] [bp-10h]@6
 
-  auto a1 = this;
+  Render* a1 = this;
   v2 = a1;
   if ( a1->pRenderD3D )
   {
@@ -4302,7 +4302,7 @@
   signed int v3; // [sp-8h] [bp-Ch]@3
   int v4; // [sp-4h] [bp-8h]@3
 
-  auto a5 = this;
+  Render* a5 = this;
   if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion != 4 )
   {
     pFront = (IDirectDrawSurface *)a5->pFrontBuffer4;
@@ -5438,7 +5438,7 @@
     //v59 = pGame->pLightmapBuilder;
     //v9 = v59->std__vector_000004_size;
 
-  auto uCorrectedColor = uColor;
+  uint uCorrectedColor = uColor;
   if (pGame->pLightmapBuilder->std__vector_000004_size)
     uCorrectedColor = 0xFFFFFFFF;
   pGame->AlterGamma_BLV(pFace, &uCorrectedColor);
@@ -6394,7 +6394,7 @@
   HRESULT v16; // eax@23
   stru350 Dst; // [sp+Ch] [bp-F8h]@12
 
-  auto pHWLTexture = pD3DBitmaps.LoadTexture(pName, bMipMaps);
+  HWLTexture* pHWLTexture = pD3DBitmaps.LoadTexture(pName, bMipMaps);
   if ( pHWLTexture )
   {
     bMipMaps = !strncmp(pName, "HDWTR", 5);
@@ -6655,7 +6655,7 @@
 
   __debugbreak();
 
-  auto ecx0 = this;
+  Render* ecx0 = this;
   v3 = 0;
 
   if (!this->pRenderD3D)
@@ -7172,7 +7172,7 @@
   unsigned __int32 twoColors = (uColor16 << 16) | uColor16;
   for (uint y = 0; y < uHeight; ++y)
   {
-    auto pDst = &pTargetSurface[uX + (y + uY) * uTargetSurfacePitch];
+    ushort* pDst = &pTargetSurface[uX + (y + uY) * uTargetSurfacePitch];
 
     memset32(pDst, twoColors, uWidth / 2);
     if (uWidth & 1)
@@ -7317,9 +7317,9 @@
   unsigned int v29; // [sp+24h] [bp+14h]@22
   unsigned int v30; // [sp+24h] [bp+14h]@31
 
-  auto a2 = x;
-  auto a3 = y;
-  auto a6 = uFontHeight;
+  int a2 = x;
+  int a3 = y;
+  uint a6 = uFontHeight;
   if ( this->uNumSceneBegins )
   {
     v8 = a5;
@@ -8434,9 +8434,9 @@
        idx2 = uNumItems;
   while (true)
   {
-    auto i = idx1 + (idx2 - idx1) / 2;
-
-    auto res = _stricmp(pName, pSpriteNames[i]);
+    uint i = idx1 + (idx2 - idx1) / 2;
+
+    int res = _stricmp(pName, pSpriteNames[i]);
     if (!res)
     {
       fseek(pFile, pSpriteOffsets[i], SEEK_SET);
@@ -8455,7 +8455,7 @@
   uint uCompressedSize = 0;
   fread(&uCompressedSize, 4, 1, pFile);
 
-    auto pTex = new HWLTexture;
+    HWLTexture* pTex = new HWLTexture;
     fread(&pTex->uBufferWidth, 4, 1, pFile);
     fread(&pTex->uBufferHeight, 4, 1, pFile);
     fread(&pTex->uAreaWidth, 4, 1, pFile);
@@ -8468,10 +8468,10 @@
     pTex->pPixels = new unsigned __int16[pTex->uWidth * pTex->uHeight];
     if (uCompressedSize)
     {
-      auto pCompressedData = new char[uCompressedSize];
+      char* pCompressedData = new char[uCompressedSize];
       {
         fread(pCompressedData, 1, uCompressedSize, pFile);
-        auto uDecompressedSize = pTex->uWidth * pTex->uHeight * sizeof(short);
+        uint uDecompressedSize = pTex->uWidth * pTex->uHeight * sizeof(short);
         zlib::MemUnzip(pTex->pPixels, &uDecompressedSize, pCompressedData, uCompressedSize);
       }
       delete [] pCompressedData;
@@ -8644,7 +8644,7 @@
 
   for (uint i = pRenderer->uNumBillboardsToDraw - 1; i != (uint)-1; --i)
   {
-    auto p = &pRenderer->pBillboardRenderListD3D[i];
+    RenderBillboardD3D* p = &pRenderer->pBillboardRenderListD3D[i];
 
     if (p->uOpacity != RenderBillboardD3D::NoBlend)
       SetBillboardBlendOptions(p->uOpacity);
--- a/SaveLoad.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/SaveLoad.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -97,7 +97,7 @@
     int e = GetLastError();
 
   pNew_LOD->LoadFile("data\\new.lod", 0);
-  auto *f = pNew_LOD->FindContainer("header.bin", 1);
+  FILE *f = pNew_LOD->FindContainer("header.bin", 1);
   if (!f)
   {
     sprintf(Str, pGlobalTXT_LocalizationStrings[612], 100);
@@ -175,7 +175,7 @@
 
   for (uint i = 0; i < 4; ++i)
   {
-    auto uQuickspell = pParty->pPlayers[i].uQuickSpell;
+    uchar uQuickspell = pParty->pPlayers[i].uQuickSpell;
     if (uQuickspell)
       stru_AA1058[i]._494836(uQuickspell, i + 9 - 8);
 
@@ -184,7 +184,7 @@
       uint uEquipIdx = pParty->pPlayers[i].pEquipment.pIndices[j];
       if (uEquipIdx)
       {
-        auto uItemID = pParty->pPlayers[i].pInventoryItemList[uEquipIdx - 1].uItemID;
+        int uItemID = pParty->pPlayers[i].pInventoryItemList[uEquipIdx - 1].uItemID;
         if (pItemsTable->pItems[uItemID].uEquipType == 12)
         {
                 __debugbreak();  // looks like offset in player's inventory and wand_lut much like case in 0042ECB5
@@ -725,10 +725,10 @@
 
     if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, DDLOCK_WAIT) )
     {
-      auto src = (unsigned __int16 *)Dst.lpSurface;
-      auto src_width = (Dst.lPitch / sizeof(short));
-      auto src_height = Dst.dwHeight;
-      auto dst = pPixels;
+      ushort* src = (unsigned __int16 *)Dst.lpSurface;
+      ulong src_width = (Dst.lPitch / sizeof(short));
+      ulong src_height = Dst.dwHeight;
+      ushort* dst = pPixels;
       for (uint y = 0; y < height; ++y)
       {
         //uint src_y = (game_viewport_y + y * v25) * (Dst.lPitch / sizeof(short));
--- a/SpriteObject.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/SpriteObject.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -1054,7 +1054,7 @@
 {
   for (uint i = 0; i < uNumSpriteObjects; ++i)
   {
-    auto item = &pSpriteObjects[i];
+    SpriteObject* item = &pSpriteObjects[i];
 
     if (item->uType &&
         (item->uSoundID & 8 || pObjectList->pObjects[item->uType].uFlags & 0x10))
--- a/Sprites.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Sprites.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -91,7 +91,7 @@
             {
             v3 = uSpriteID;
 
-            auto uFlags = pSpriteSFrames[v3].uFlags;
+            int uFlags = pSpriteSFrames[v3].uFlags;
             if (!(uFlags & 0x0080))  //not loaded
                 {
                 pSpriteSFrames[v3].uFlags |= 0x80; //set loaded
@@ -394,11 +394,11 @@
 
   pSpritePFrames = (SpriteFrame **)malloc(4 * uNumSpriteFrames);
 
-  auto mm7_frames_size = num_mm7_frames * sizeof(SpriteFrame);
+  uint mm7_frames_size = num_mm7_frames * sizeof(SpriteFrame);
   memcpy(pSpriteSFrames, (char *)data_mm7 + 8, mm7_frames_size);
   memcpy(pSpriteEFrames, (char *)data_mm7 + 8 + mm7_frames_size, 2 * num_mm7_eframes);
 
-  auto mm6_frames_size = num_mm6_frames * sizeof(SpriteFrame_mm6);
+  uint mm6_frames_size = num_mm6_frames * sizeof(SpriteFrame_mm6);
   for (uint i = 0; i < num_mm6_frames; ++i)
   {
     memcpy(pSpriteSFrames + num_mm7_frames + i, (char *)data_mm6 + 8 + i * sizeof(SpriteFrame_mm6), sizeof(SpriteFrame_mm6));
@@ -406,7 +406,7 @@
   }
   memcpy(pSpriteEFrames + num_mm7_frames, (char *)data_mm6 + 8 + mm6_frames_size, 2 * num_mm6_eframes);
 
-  auto mm8_frames_size = num_mm8_frames * sizeof(SpriteFrame);
+  uint mm8_frames_size = num_mm8_frames * sizeof(SpriteFrame);
   memcpy(pSpriteSFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 8, mm8_frames_size);
   memcpy(pSpriteEFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 8 + mm8_frames_size, 2 * num_mm8_eframes);
 
--- a/Texture.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Texture.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -1171,7 +1171,7 @@
 
 
 
-      auto pOutPixels = pPixels;
+      ushort* pOutPixels = pPixels;
  
  memset(pOutPixels, 0, uNumPixels * sizeof(__int16));
 
--- a/TileTable.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/TileTable.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -96,7 +96,7 @@
   FILE *v2; // eax@1
   FILE *v3; // edi@1
 
-  auto Str = this;
+  TileTable* Str = this;
 
   v1 = Str;
   v2 = fopen("data\\dtile.bin", "wb");
--- a/TurnEngine.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/TurnEngine.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -658,7 +658,7 @@
                 monster_ai_state == AIState::Fidgeting)
                 {
                 pQueue[i].actor_initiative = pMonsterStats->pInfos[monster->pMonsterInfo.uID].uRecoveryTime;
-                if (monster->pActorBuffs[7].uExpireTime > 0)
+                if (monster->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime > 0)
                     pQueue[i].actor_initiative*=2;
                 }
             }
@@ -727,7 +727,7 @@
                          switch (v3)
                          {
                            case  AIState::AttackingMelee:
-                             v19 = stru_50C198.special_ability_use_check(&pActors[v4], v4);
+                             v19 = pActors[v4].special_ability_use_check(v4);
                              stru_50FE08.Add( v28->uPackedID,  5120,  v5->vPosition.x, v5->vPosition.y, v5->vPosition.z + ((signed int)v5->uActorHeight >> 1), v19,  1);
                              Actor::AI_Stand(v4, a2a, 0, &a4);
                              break;
@@ -848,7 +848,7 @@
                 
                 if ( v5->pMonsterInfo.uHostilityType == 4 && v22 && (signed int)v9 < 5120 )
                     {
-                    v14 = stru_50C198.special_ability_use_check(v5, actor_id);
+                    v14 = v5->special_ability_use_check(actor_id);
                     v21->AI_action_type = TE_AI_STAND;
                     switch (v14)
                         {
@@ -966,7 +966,7 @@
         if (PID_TYPE(pQueue[i].uPackedID) == OBJECT_Actor)
             {
             v6 = &pActors[PID_ID(pQueue[i].uPackedID)];
-            if ( !(v6->pActorBuffs[5].uExpireTime > 0|| (v6->pActorBuffs[6].uExpireTime > 0) || 
+            if ( !(v6->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime > 0|| (v6->pActorBuffs[ACTOR_BUFF_PARALYZED].uExpireTime > 0) || 
                     v6->uAIState == AIState::Dead || v6->uAIState == AIState::Removed || v6->uAIState == AIState::Disabled) )
                 {
                 v13 = ai_near_actors_targets_pid[PID_ID(pQueue[i].uPackedID)];
@@ -1061,7 +1061,7 @@
         break;
         }
 
-    if ( actor->pActorBuffs[4].uExpireTime > 0 )
+    if ( actor->pActorBuffs[ACTOR_BUFF_AFRAID].uExpireTime > 0 )
         {
         if (v11 < 10240 )
             {
--- a/UI/UICharacter.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/UI/UICharacter.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -479,15 +479,15 @@
   int num_skills_drawn = 0;
   for (int i = 0; i < skill_list_size; ++i)
   {
-    auto skill = (PLAYER_SKILL_TYPE)skill_list[i];
+    PLAYER_SKILL_TYPE skill = (PLAYER_SKILL_TYPE)skill_list[i];
     for (uint j = 0; j < pGUIWindow_CurrentMenu->uNumControls; ++j)
     {
-      auto v8 = pGUIWindow_CurrentMenu->pControlsHead;
+      GUIButton* v8 = pGUIWindow_CurrentMenu->pControlsHead;
 
       for (int v7 = j; v7 > 0; --v7)
         v8 = v8->pNext;
 
-      auto v9 = v8->field_1C;
+      int v9 = v8->field_1C;
       if ((short)(v8->field_1C) >= 0)
         continue;
       if ( (v9 & 0x7FFF) != skill )
@@ -496,8 +496,8 @@
       ++num_skills_drawn;
       y_offset = v8->uY;
 
-      auto skill_value = player->pActiveSkills[skill];
-      auto skill_level = skill_value & 0x3F;
+      ushort skill_value = player->pActiveSkills[skill];
+      int skill_level = skill_value & 0x3F;
 
       uint skill_color = 0;
       uint skill_mastery_color = 0;
@@ -1575,12 +1575,13 @@
     v17 = uCellX + ((v15 - pTexture->uTextureWidth) >> 1) + pSRZBufferLineOffsets[uCellY + (( (int)((pTexture->uTextureHeight - 14) & 0xFFFFFFE0) - pTexture->uTextureHeight + 32) >> 1)];   //added typecast. without it the value in the brackets got cat to unsigned which messed stuff up
     if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0)
     {
+      Texture *loadedTextureptr = nullptr;
       switch (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0)
       {
-        case ITEM_AURA_EFFECT_RED:    pTexture = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break;
-        case ITEM_AURA_EFFECT_BLUE:   pTexture = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE);    break;
-        case ITEM_AURA_EFFECT_GREEN:  pTexture = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE);    break;
-        case ITEM_AURA_EFFECT_PURPLE: pTexture = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE);    break;
+        case ITEM_AURA_EFFECT_RED:    loadedTextureptr = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break;
+        case ITEM_AURA_EFFECT_BLUE:   loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE);    break;
+        case ITEM_AURA_EFFECT_GREEN:  loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE);    break;
+        case ITEM_AURA_EFFECT_PURPLE: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE);    break;
       }
       _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
       if (_50C9A8_item_enchantment_timer <= 0)
@@ -1589,7 +1590,8 @@
         LOBYTE(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes) &= 0xF;
         ptr_50C9A4_ItemToEnchant = 0;
       }
-      pRenderer->DrawAura(uCellX, uCellY, pTexture, pTexture, GetTickCount() * 0.1, 0, 255);
+
+      pRenderer->DrawAura(uCellX, uCellY, pTexture, loadedTextureptr, GetTickCount() * 0.1, 0, 255);
       ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]);
     }
     else
@@ -1611,7 +1613,7 @@
 
 static void CharacterUI_DrawItem(int x, int y, ItemGen *item, int id)
 {
-  auto item_texture = pIcons_LOD->LoadTexturePtr(item->GetIconName(), TEXTURE_16BIT_PALETTE);
+  Texture* item_texture = pIcons_LOD->LoadTexturePtr(item->GetIconName(), TEXTURE_16BIT_PALETTE);
 
   if (item->uAttributes & 0xF0) // enchant animation
   {
@@ -1767,7 +1769,7 @@
   memset(byte_5111F6.data(), 0, sizeof(byte_5111F6));
   for (uint i = 0; i < 4; ++i)
   {
-    auto player = &pParty->pPlayers[i];
+    Player* player = &pParty->pPlayers[i];
 
     if (player->HasItem(ITEM_ARTIFACT_GOVERNORS_ARMOR, 1))    byte_5111F6[0] = 1;
     if (player->HasItem(ITEM_ARTIFACT_YORUBA, 1))             byte_5111F6[1] = 1;
--- a/UI/UIPopup.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/UI/UIPopup.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -576,7 +576,7 @@
         {
           v21 = dst_x;
           v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x];
-          auto _v22_2 = v22;
+          ushort* _v22_2 = v22;
           v23 = i - dst_y;
           v115 = i - dst_y;
           while ( 1 )
@@ -616,11 +616,11 @@
       pDesc.dwSize = 124;
       if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT) )
       {
-        auto src = (unsigned __int16 *)pDesc.lpSurface;
+        ushort* src = (unsigned __int16 *)pDesc.lpSurface;
         uint num_top_scanlines_above_frame_y = i - dst_y;
         for (uint y = dst_y; y < dst_w; ++y)
         {
-          auto dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x];
+          ushort* dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x];
 
           uint src_y = num_top_scanlines_above_frame_y + y;
           for (uint x = dst_x; x < dst_z; ++x)
@@ -1602,7 +1602,9 @@
 
   pMouse->GetCursorPos(&cursor);
   int item_pid = (pRenderer->pActiveZBuffer[cursor.x + pSRZBufferLineOffsets[cursor.y]] & 0xFFFF) - 1;
-  auto item = &pPlayers[uActiveCharacter]->pInventoryItemList[item_pid];
+  if (item_pid == -1) //added here to avoid crash
+    return;
+  ItemGen* item = &pPlayers[uActiveCharacter]->pInventoryItemList[item_pid];
 
   if (cursor.x <= 13 || cursor.x >= 462)//items out of inventory(  )
   {
--- a/UI/UISaveLoad.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/UI/UISaveLoad.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -85,9 +85,9 @@
     }
     else
       am = 0;
-    auto day = aDayNames[full_days % 7];
-    auto ampm = aAMPMNames[am];
-    auto month = aMonthNames[current_month];
+    const char* day = aDayNames[full_days % 7];
+    const char* ampm = aAMPMNames[am];
+    const char* month = aMonthNames[current_month];
 
     sprintfex(pTmpBuf.data(), "%s %d:%02d %s\n%d %s %d", day, current_hour, current_minutes, aAMPMNames[am], current_day + 1, month, current_year);
     save_load_window.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf.data(), 3);
--- a/UI/UIShops.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/UI/UIShops.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -1602,7 +1602,7 @@
           {
             item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1];
             pPriceMultiplier = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
-            auto _v = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1];
+            ItemGen* _v = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1];
             uPriceItemService = pPlayers[uActiveCharacter]->GetPriceRepair(_v->GetValue(), pPriceMultiplier);
             if ( item->uAttributes & 2 )
             {
--- a/UI/UiGame.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/UI/UiGame.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -40,10 +40,10 @@
 //----- (00421D00) --------------------------------------------------------
 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID)
 {
-  auto player = &pParty->pPlayers[uPlayerID - 1];
+  Player* player = &pParty->pPlayers[uPlayerID - 1];
   if (pParty->pPickedItem.uItemID)
   {
-    if (auto slot = player->AddItem(-1, pParty->pPickedItem.uItemID))
+    if (int slot = player->AddItem(-1, pParty->pPickedItem.uItemID))
     {
       memcpy(&player->pInventoryItemList[slot-1], &pParty->pPickedItem, 0x24u);
       viewparams->bRedrawGameUI = true;
@@ -437,7 +437,7 @@
       }
       else if (pGreetType == 2)//HiredNPC_greet
       {
-        auto prof = pNPCStats->pProfessions + pNPC->uProfession;
+        NPCProfession* prof = &pNPCStats->pProfessions[pNPC->uProfession];
 
         if (pNPC->Hired())
           pInString = BuildDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0);
@@ -452,7 +452,7 @@
   {
     window.uFrameWidth = game_viewport_width;
     window.uFrameZ = 452;
-    auto font = pFontArrus;
+    GUIFont* font = pFontArrus;
     pTextHeight = pFontArrus->CalcTextHeight(pInString, &window, 13, 0) + 7;
     if ( 352 - pTextHeight < 8 )
     {
@@ -820,7 +820,7 @@
   uFramesetIDa = 0;
   for (uint i = 0; i < 24; ++i)
   {
-    auto buff = player->pPlayerBuffs.data() + i;
+    SpellBuff* buff = &player->pPlayerBuffs[i];
     if (buff->uExpireTime > 0)
     {
       v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134;
@@ -850,7 +850,7 @@
   pFontHeight = LOBYTE(pFontArrus->uFontHeight) + 1;
   for ( uint i = 0; i < 4; ++i )
   {
-    auto player = &pParty->pPlayers[i];
+    Player* player = &pParty->pPlayers[i];
     pX = 94 * i + 89;
     if ( i == 0 )
       pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, 18, 0, pGlobalTXT_LocalizationStrings[149], 60, 0);//Name
@@ -1644,7 +1644,7 @@
     //v2 =  byte_4E5DD8[v1];
     if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime)
     {
-      auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]);
+      Texture* tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]);
       //v3 = pTextureIDs_PartyBuffIcons[i];
       pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0],
       pPartySpellbuffsUI_XYs[i][1], tex, tex,
@@ -1841,8 +1841,8 @@
   uCenterX = (uX + uZ) / 2;
   uCenterY = (uY + uW) / 2;
   lPitch = pRenderer->uTargetSurfacePitch;
-  auto bWizardEyeActive = pParty->WizardEyeActive();
-  auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel();
+  bool bWizardEyeActive = pParty->WizardEyeActive();
+  int uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel();
   if ( CheckHiredNPCSpeciality(Cartographer) )
   {
     bWizardEyeActive = true;
@@ -1860,8 +1860,8 @@
 
   if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
   {
-    auto pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask;
-    auto pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
+    uchar* pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask;
+    ushort* pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
     v73 = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / (signed int)uZoom;
     v20 = (double)(pParty->vPosition.x + 32768) / (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
     uWb = (double)(32768 - pParty->vPosition.y) / (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
@@ -1898,12 +1898,12 @@
       assert(uWidth == 137 && uHeight == 117);
       //auto pMinimap = (unsigned __int16 *)pOdmMinimap;
 
-      auto mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
+      ushort mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
 
       v29 = v70 >> 16;
       for (int y = 0; y < uHeight; ++y)
       {
-        auto pMapLod0Line = &pMapLod0[v27 * mapWidth];
+        uchar* pMapLod0Line = &pMapLod0[v27 * mapWidth];
         for (int x = 0; x < uWidth; ++x)
         {
           //*pMinimap++ = pPal[pMapLod0Line[v29]];
@@ -1934,9 +1934,9 @@
 
     for (uint i = 0; i < (uint)pIndoor->pMapOutlines->uNumOutlines; ++i)
     {
-      auto pOutline = &pIndoor->pMapOutlines->pOutlines[i];
-      auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID;
-      auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID;
+      BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[i];
+      BLVFace* pFace1 = pIndoor->pFaces + pOutline->uFace1ID;
+      BLVFace* pFace2 = pIndoor->pFaces + pOutline->uFace2ID;
       //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes;
         //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes;
       if (pFace1->Visible() && pFace2->Visible())
@@ -1963,9 +1963,9 @@
       }
       else
       {
-        auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x);
-        auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16);
-        auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16);
+        long long _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x);
+        uint _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16);
+        int _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16);
         pX = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16);
         pY = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16);
         pZ = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16);
@@ -1979,7 +1979,7 @@
 
     for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i)
     {
-      auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]];
+      BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]];
       pX = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16);
       pY = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16);
       pZ = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16);
@@ -2119,12 +2119,12 @@
   {
     if (pParty->TorchlightActive())
     {
-      auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time());
+      IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time());
       pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID));
     }
     if (pParty->WizardEyeActive())
     {
-      auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time());
+      IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time());
       pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID));
     }
   }
--- a/VideoPlayer.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/VideoPlayer.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -117,7 +117,7 @@
       v11.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
       v11.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
 
-      auto hr = pRenderer->pDirectDraw4->CreateSurface(&v11, &v15, 0);
+      long hr = pRenderer->pDirectDraw4->CreateSurface(&v11, &v15, 0);
       ErrD3D(hr);
     }
     v5->uWidth = v11.dwWidth;
@@ -161,7 +161,7 @@
       Dst.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
       Dst.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
 
-      auto hr = pRenderer->pDirectDraw2->CreateSurface(&Dst, (LPDIRECTDRAWSURFACE *)&a2, 0);
+      long hr = pRenderer->pDirectDraw2->CreateSurface(&Dst, (LPDIRECTDRAWSURFACE *)&a2, 0);
       ErrD3D(hr);
     }
     v5->uWidth = Dst.dwWidth;
--- a/Viewport.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Viewport.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -358,7 +358,7 @@
     {
       if ( (unsigned int)v0 < 0x2000000 )
       {
-        stru_50C198.LootActor(&pActors[v16]);
+        pActors[v16].LootActor();
         return;
       }
       if ( !pParty->pPickedItem.uItemID )
--- a/Vis.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Vis.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -60,7 +60,7 @@
   else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
   {
     uint bmodel_id = pid >> 9;
-    auto v = (Vec3_int_ *)pOutdoor->pBModels[bmodel_id].pVertices.pVertices;
+    Vec3_int_* v = (Vec3_int_ *)pOutdoor->pBModels[bmodel_id].pVertices.pVertices;
     for (uint i = 0; i < face->uNumVertices; ++i)
     {
       static_DetermineFacetIntersection_array_F8F200[i].vWorldPosition.x = v[face->pVertexIDs[i]].x;
@@ -127,7 +127,7 @@
   //v6 = pRenderer->pBillboardRenderListD3D;
   for (uint i = 0; i < pRenderer->uNumBillboardsToDraw; ++i)
   {
-    auto billboard = pRenderer->pBillboardRenderListD3D + i;
+    RenderBillboardD3D* billboard = &pRenderer->pBillboardRenderListD3D[i];
     if (IsPointInsideD3DBillboard(billboard, x, y))
     {
       if (v13 == -1)
@@ -155,7 +155,7 @@
     //v9 = a1;
     //do
     //{
-    auto v = vertices + i;
+    RenderVertexSoft* v = &vertices[i];
 
     if (v->vWorldViewProjX < min_x)
       min_x = v->vWorldViewProjX;
@@ -216,12 +216,12 @@
 {
   for (uint i = 0; i < pRenderer->uNumBillboardsToDraw; ++i)
   {
-    auto d3d_billboard = &pRenderer->pBillboardRenderListD3D[i];
+    RenderBillboardD3D* d3d_billboard = &pRenderer->pBillboardRenderListD3D[i];
     if (is_part_of_selection((void *)i, filter) && IsPointInsideD3DBillboard(d3d_billboard, fX, fY))
     {
       if (DoesRayIntersectBillboard(fPickDepth, i))
       {
-        auto billboard = &pBillboardRenderList[d3d_billboard->uParentBillboardID];
+        RenderBillboard* billboard = &pBillboardRenderList[d3d_billboard->uParentBillboardID];
 
         list->AddObject((void *)d3d_billboard->uParentBillboardID, VisObjectType_Sprite, billboard->sZValue);
       }
@@ -322,7 +322,7 @@
     {
       if ( pFaceID < (signed int)pIndoor->uNumFaces )
       {
-        auto face = pIndoor->pFaces + pFaceID;
+        BLVFace* face = &pIndoor->pFaces[pFaceID];
         if ( is_part_of_selection(face, filter) )
         {
           if ( !pGame->pIndoorCameraD3D->IsCulled(face) )
@@ -372,10 +372,10 @@
     if (!reachable && only_reachable)
       continue;
 
-    auto bmodel = &pOutdoor->pBModels[i];
+    BSPModel* bmodel = &pOutdoor->pBModels[i];
     for (uint j = 0; j < bmodel->uNumFaces; ++j)
     {
-      auto face = &bmodel->pFaces[j];
+      ODMFace* face = &bmodel->pFaces[j];
       if (is_part_of_selection(face, filter))
       {
         BLVFace blv_face;
@@ -1373,13 +1373,13 @@
 {
   for (int i = 0; i < pRenderer->uNumBillboardsToDraw; ++i)
   {
-    auto d3d_billboard = &pRenderer->pBillboardRenderListD3D[i];
+    RenderBillboardD3D* d3d_billboard = &pRenderer->pBillboardRenderListD3D[i];
 
     if (is_part_of_selection((void *)i, filter))
     {
       if (DoesRayIntersectBillboard(pick_depth, i))
       {
-        auto billboard = &pBillboardRenderList[d3d_billboard->uParentBillboardID];
+        RenderBillboard* billboard = &pBillboardRenderList[d3d_billboard->uParentBillboardID];
 
         list->AddObject((void *)d3d_billboard->uParentBillboardID, VisObjectType_Sprite, billboard->sZValue);
       }
@@ -1467,13 +1467,13 @@
       bool no_event = true;
       if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
       {
-        auto face = (ODMFace *)uD3DBillboardIdx_or_pBLVFace_or_pODMFace;
+        ODMFace* face = (ODMFace *)uD3DBillboardIdx_or_pBLVFace_or_pODMFace;
         no_event = face->sCogTriggeredID == 0;
         face_attrib = face->uAttributes;
       }
       else if (uCurrentlyLoadedLevelType == LEVEL_Indoor) 
       {
-        auto face = (BLVFace *)uD3DBillboardIdx_or_pBLVFace_or_pODMFace;
+        BLVFace* face = (BLVFace *)uD3DBillboardIdx_or_pBLVFace_or_pODMFace;
         no_event = pIndoor->pFaceExtras[face->uFaceExtraID].uEventID == 0;
         face_attrib = face->uAttributes;
       }
@@ -1684,10 +1684,10 @@
     if (!v17)
       continue;
 
-    auto bmodel = pOutdoor->pBModels + i;
+    BSPModel* bmodel = &pOutdoor->pBModels[i];
     for (uint j = 0; j < bmodel->uNumFaces; ++j)
     {
-      auto face = &bmodel->pFaces[j];
+      ODMFace* face = &bmodel->pFaces[j];
 
       if (is_part_of_selection(face, filter) )
       {
@@ -1695,7 +1695,7 @@
         blv_face.FromODM(face);
 
         int pid = PID(OBJECT_BModel, j | (i << 6));
-        if (auto object_info = DetermineFacetIntersection(&blv_face, pid, pick_depth))
+        if (Vis_ObjectInfo* object_info = DetermineFacetIntersection(&blv_face, pid, pick_depth))
           list->AddObject(object_info->object, object_info->object_type, object_info->sZValue);
       }
     }
--- a/Weather.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/Weather.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -217,7 +217,7 @@
   screen_x = viewparams->uScreen_topL_X;
   screen_z_minus_4 = viewparams->uScreen_BttmR_X - 4;
 
-  auto _this = this->field_0;
+  short* _this = this->field_0;
   while ( 1 )
   {
     v6 = &_this[2 * v4];
--- a/mm7_2.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/mm7_2.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -115,7 +115,7 @@
     {
       for (int i = 0; i < 4; ++i)
       {
-        auto player = &pParty->pPlayers[i];
+        Player* player = &pParty->pPlayers[i];
         player->sHealth = player->GetMaxHealth();
 
         for (int j = 0; j < 14; ++j)
@@ -129,11 +129,11 @@
     {
       for (int i = 0; i < 4; ++i)
       {
-        auto player = &pParty->pPlayers[i];
+        Player* player = &pParty->pPlayers[i];
         player->sHealth = player->GetMaxHealth();
 
-        auto v5 = LODWORD(player->pConditions[19]);//*((int *)v4 - 32);
-        auto v6 = HIDWORD(player->pConditions[19]);//*((int *)v4 - 31);
+        int v5 = LODWORD(player->pConditions[19]);//*((int *)v4 - 32);
+        int v6 = HIDWORD(player->pConditions[19]);//*((int *)v4 - 31);
         memset(player->pConditions.data(), 0, 0xA0u);
 
         __debugbreak();
@@ -173,7 +173,7 @@
       }
       else
       {
-        auto v19 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536);
+        int v19 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536);
         pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + 60 * (256 * 2), 3, 1, v19, 0);
         pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags |= 1u;
         pAudioPlayer->PlaySound(SOUND_11090, 0, 0, -1, 0, 0, 0, 0);
@@ -183,7 +183,7 @@
 
     case WaterMaster:
     {
-      auto v20 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536);
+      int v20 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536);
       pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply(pParty->uTimePlayed + 60 * (256 * (2 + 1)), 3, 0, v20, 0);
       pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags |= 1u;
       pAudioPlayer->PlaySound(SOUND_12040, 0, 0, -1, 0, 0, 0, 0);
@@ -451,7 +451,7 @@
       pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1,
       pRenderer->uTargetGMask | pRenderer->uTargetBMask);
 
-  auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
+  Texture* pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
   pRenderer->GetLeather(8, 352 - v0, pTex, pTex->uTextureHeight - v0);
 
   pRenderer->DrawTextureIndexed(8u, 347 - v0, pTexture_591428);
@@ -1409,7 +1409,7 @@
       if ( v20 == uNumActors )
         ++uNumActors;
       v6->uSummonerID = PID(OBJECT_Player, a1);
-      result = v6->pActorBuffs[2].Apply(pParty->uTimePlayed + (a3 * 128) / 30.0f,
+      result = v6->pActorBuffs[ACTOR_BUFF_SUMMONED].Apply(pParty->uTimePlayed + (a3 * 128) / 30.0f,
                  a2,
                  a1,
                  0,
@@ -1779,7 +1779,7 @@
   uint decorEventIdx = 0;
   for (uint i = 0; i < uNumLevelDecorations; ++i)
   {
-    auto decor = &pLevelDecorations[i];
+    LevelDecoration* decor = &pLevelDecorations[i];
 
     if (!decor->uEventID)
     {
@@ -2142,8 +2142,8 @@
   int highIdx;
   int angle;
 
-  auto X = x;
-  auto Y = y;
+  int X = x;
+  int Y = y;
 
   if ( abs(X) < 65536 )
   {
@@ -2867,7 +2867,7 @@
   for (uint i = 0; i < uNumActors; ++i)
   //if ( (signed int)uNumActors > 0 )
   {
-    auto pActor = &pActors[i];
+    Actor* pActor = &pActors[i];
     //v2 = (char *)&pActors[0].uNPC_ID;
     //do
     //{
@@ -2918,7 +2918,7 @@
 
   for (uint i = 0; i < uNumActors; ++i)
   {
-    auto pActor = &pActors[i];
+    Actor* pActor = &pActors[i];
     //v7 = (char *)&pActors[0].pMonsterInfo;
     //do
     //{
@@ -2958,7 +2958,7 @@
       v18 = 4;
       v10 = &pMonsterStats->pInfos[v9 + 1];
       //v11 = (int *)pMonsterList->pMonsters[v9].pSoundSampleIDs;
-      auto v11 = &pMonsterList->pMonsters[v9];
+      MonsterDesc* v11 = &pMonsterList->pMonsters[v9];
       do
       {
         pSoundList->LoadSound(v11->pSoundSampleIDs[4 - v18], 0);
@@ -3032,10 +3032,10 @@
   pIcons_LOD->_inlined_sub2();
 
   pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
-  auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
-  auto pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
-  auto pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE);
-  auto pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
+  Texture* pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
+  Texture* pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE);
+  Texture* pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE);
+  Texture* pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE);
 
   pMainMenu_BtnNew     = pWindow_MainMenu->CreateButton(495, 172, pNew->uTextureWidth,     pNew->uTextureHeight,     1, 0, UIMSG_MainMenu_ShowPartyCreationWnd, 0, 'N', "", pNew, 0);
   pMainMenu_BtnLoad    = pWindow_MainMenu->CreateButton(495, 227, pLoad->uTextureWidth,    pLoad->uTextureHeight,    1, 0, UIMSG_MainMenu_ShowLoadWindow,       1, 'L', "", pLoad, 0);
@@ -3508,7 +3508,7 @@
   memcpy(Filename, "X:\\anims\\magic7.vid", sizeof(Filename));
   *Filename = c;
 
-  auto f = fopen(Filename, "rb");
+  FILE* f = fopen(Filename, "rb");
   if (!f)
     return false;
 
@@ -3883,7 +3883,7 @@
   {
     void *sft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dsft.bin", 1) : nullptr,
          *sft_mm8 = nullptr;
-    auto  sft_mm7 = pEvents_LOD->LoadRaw("dsft.bin", 1);
+    void*  sft_mm7 = pEvents_LOD->LoadRaw("dsft.bin", 1);
     pSpriteFrameTable = new SpriteFrameTable;
     pSpriteFrameTable->FromFile(sft_mm6, sft_mm7, sft_mm8);
     free(sft_mm6);
@@ -3892,7 +3892,7 @@
     
     void *tft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dtft.bin", 1) : nullptr,
          *tft_mm8 = nullptr;
-    auto  tft_mm7 = pEvents_LOD->LoadRaw("dtft.bin", 1);
+    void*  tft_mm7 = pEvents_LOD->LoadRaw("dtft.bin", 1);
     pTextureFrameTable = new TextureFrameTable;
     pTextureFrameTable->FromFile(tft_mm6, tft_mm7, tft_mm8);
     free(tft_mm6);
@@ -3901,7 +3901,7 @@
 
     void *tiles_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dtile.bin", 1) : nullptr,
          *tiles_mm8 = nullptr;
-    auto  tiles_mm7 = pEvents_LOD->LoadRaw("dtile.bin", 1);
+    void*  tiles_mm7 = pEvents_LOD->LoadRaw("dtile.bin", 1);
     pTileTable = new TileTable;
     pTileTable->FromFile(tiles_mm6, tiles_mm7, tiles_mm8);
     free(tiles_mm6);
@@ -3910,7 +3910,7 @@
     
     void *pft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dpft.bin", 1) : nullptr,
          *pft_mm8 = nullptr;
-    auto  pft_mm7 = pEvents_LOD->LoadRaw("dpft.bin", 1);
+    void*  pft_mm7 = pEvents_LOD->LoadRaw("dpft.bin", 1);
     pPlayerFrameTable = new PlayerFrameTable;
     pPlayerFrameTable->FromFile(pft_mm6, pft_mm7, pft_mm8);
     free(pft_mm6);
@@ -3919,7 +3919,7 @@
 
     void *ift_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dift.bin", 1) : nullptr,
          *ift_mm8 = nullptr;
-    auto  ift_mm7 = pEvents_LOD->LoadRaw("dift.bin", 1);
+    void*  ift_mm7 = pEvents_LOD->LoadRaw("dift.bin", 1);
     pIconsFrameTable = new IconFrameTable;
     pIconsFrameTable->FromFile(ift_mm6, ift_mm7, ift_mm8);
     free(ift_mm6);
@@ -3928,7 +3928,7 @@
 
     void *decs_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("ddeclist.bin", 1) : nullptr,
          *decs_mm8 = nullptr;
-    auto  decs_mm7 = pEvents_LOD->LoadRaw("ddeclist.bin", 1);
+    void*  decs_mm7 = pEvents_LOD->LoadRaw("ddeclist.bin", 1);
     pDecorationList = new DecorationList;
     pDecorationList->FromFile(decs_mm6, decs_mm7, decs_mm8);
     free(decs_mm6);
@@ -3937,7 +3937,7 @@
 
     void *objs_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dobjlist.bin", 1) : nullptr,
          *objs_mm8 = nullptr;
-    auto  objs_mm7 = pEvents_LOD->LoadRaw("dobjlist.bin", 1);
+    void*  objs_mm7 = pEvents_LOD->LoadRaw("dobjlist.bin", 1);
     pObjectList = new ObjectList;
     pObjectList->FromFile(objs_mm6, objs_mm7, objs_mm8);
     free(objs_mm6);
@@ -3946,7 +3946,7 @@
 
     void *mons_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dmonlist.bin", 1) : nullptr,
          *mons_mm8 = nullptr;
-    auto  mons_mm7 = pEvents_LOD->LoadRaw("dmonlist.bin", 1);
+    void*  mons_mm7 = pEvents_LOD->LoadRaw("dmonlist.bin", 1);
     pMonsterList = new MonsterList;
     pMonsterList->FromFile(mons_mm6, mons_mm7, mons_mm8);
     free(mons_mm6);
@@ -3955,7 +3955,7 @@
     
     void *chests_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dchest.bin", 1) : nullptr,
          *chests_mm8 = nullptr;
-    auto  chests_mm7 = pEvents_LOD->LoadRaw("dchest.bin", 1);
+    void*  chests_mm7 = pEvents_LOD->LoadRaw("dchest.bin", 1);
     pChestList = new ChestList;
     pChestList->FromFile(chests_mm6, chests_mm7, chests_mm8);
     free(chests_mm6);
@@ -3964,7 +3964,7 @@
 
     void *overlays_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("doverlay.bin", 1) : nullptr,
          *overlays_mm8 = nullptr;
-    auto  overlays_mm7 = pEvents_LOD->LoadRaw("doverlay.bin", 1);
+    void*  overlays_mm7 = pEvents_LOD->LoadRaw("doverlay.bin", 1);
     pOverlayList = new OverlayList;
     pOverlayList->FromFile(overlays_mm6, overlays_mm7, overlays_mm8);
     free(overlays_mm6);
@@ -3973,7 +3973,7 @@
 
     void *sounds_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dsounds.bin", 1) : nullptr,
          *sounds_mm8 = nullptr;
-    auto  sounds_mm7 = pEvents_LOD->LoadRaw("dsounds.bin", 1);
+    void*  sounds_mm7 = pEvents_LOD->LoadRaw("dsounds.bin", 1);
     pSoundList = new SoundList;
     pSoundList->FromFile(sounds_mm6, sounds_mm7, sounds_mm8);
     free(sounds_mm6);
@@ -4372,7 +4372,7 @@
     Log::Warning(L"MM: entering main loop");
     while ( 1 )
     {
-      auto main_menu_window = MainMenuWindow::Create();
+      MainMenuWindow* main_menu_window = MainMenuWindow::Create();
       window->AddControl(main_menu_window);
 
       MainMenu_Loop();
--- a/mm7_3.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/mm7_3.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -979,7 +979,7 @@
     if ( v0->uCurrentActionAnimation == ANIM_Walking )
     {
       v8 = v0->uMovementSpeed;
-      if ( (signed __int64)v0->pActorBuffs[7].uExpireTime > 0 )
+      if ( (signed __int64)v0->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime > 0 )
       {
         v8 = (signed __int64)((double)v8 * 0.5);
       }
@@ -1312,7 +1312,7 @@
   //v20 = 0;
   for (uint i = 0; i < uNumSpriteObjects; ++i)
   {
-    auto item = &pSpriteObjects[i];
+    SpriteObject* item = &pSpriteObjects[i];
     //v2 = (char *)&item->uSpriteFrameID;
     //do
     //{
@@ -1544,7 +1544,7 @@
   bJumping = 0;
 
   uFaceID = -1;
-  auto floor_level = collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID);
+  int floor_level = collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID);
 
   if ( pParty->bFlying )
   {
@@ -1572,7 +1572,7 @@
   blv_prev_party_y = pParty->vPosition.z;
   if (!pParty->bTurnBasedModeOn)
   {
-    auto v67 = GetTickCount() / 500;
+    int v67 = GetTickCount() / 500;
     if (dword_720CDC != v67 )
     {
       dword_4F8580[3 * dword_4F8580[1]] = pParty->vPosition.x;
@@ -1611,7 +1611,7 @@
       pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
     else for (uint i = 0; i < 4; ++i)
     {                                      // receive falling damage
-      auto player = &pParty->pPlayers[i];
+      Player* player = &pParty->pPlayers[i];
       if (!player->HasEnchantedItemEquipped(72) && !player->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS))
       {
         player->ReceiveDamage((pParty->uFallStartY - party_z) * (0.1f * player->GetMaxHealth()) / 256, DMGT_PHISYCAL);
@@ -1647,7 +1647,7 @@
 
     if (!bJumping && pParty->floor_face_pid != uFaceID)
     {
-      auto pFace = &pIndoor->pFaces[uFaceID];
+      BLVFace* pFace = &pIndoor->pFaces[uFaceID];
       if (pFace->uAttributes & FACE_PRESSURE_PLATE)
         uFaceEvent = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID;
     }
@@ -1806,7 +1806,7 @@
   stru_721530.field_70 = 0;
   stru_721530.prolly_normal_d = pParty->field_14_radius;
   stru_721530.field_8_radius = pParty->field_14_radius / 2;
-  auto v83 = 0;
+  int v83 = 0;
   stru_721530.field_0 = 1;
   stru_721530.height = pParty->uPartyHeight - 32;
   while ( 1 )
@@ -1866,7 +1866,7 @@
     v43 = stru_721530.uFaceID;
     uSectorID = stru_721530.uSectorID;
     stru_721530.field_70 += stru_721530.field_7C;
-    auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16) + new_party_z;
+    unsigned long long v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16) + new_party_z;
     if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Actor)
     {
       if ( SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) >= 0
@@ -2156,7 +2156,7 @@
   pY = pParty->vPosition.y;
   v113 = pParty->field_6F0;
   bJumping = 0;
-  auto partyAtHighSlope = IsTerrainSlopeTooHigh(pParty->vPosition.x, pParty->vPosition.y);
+  bool partyAtHighSlope = IsTerrainSlopeTooHigh(pParty->vPosition.x, pParty->vPosition.y);
   v114 = 0;
   v124 = 0;
   v102 = 0;
@@ -2205,7 +2205,7 @@
     }
     else for (int _i = 0; _i < 4; ++_i)     // receive falling damage
     {
-      auto player = &pParty->pPlayers[_i];
+      Player* player = &pParty->pPlayers[_i];
 
       if ( !player->HasEnchantedItemEquipped(72) && !player->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS) )
       {
@@ -2637,7 +2637,7 @@
 		{ // falling scream
 		  for (int i = 0; i < 4; ++i)
 		  {
-			auto player = &pParty->pPlayers[i];
+			Player* player = &pParty->pPlayers[i];
 			if (!player->HasEnchantedItemEquipped(72) && !player->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS) && player->CanAct())
 			  player->PlaySound(SPEECH_66, 0);
 		  }
@@ -2702,7 +2702,7 @@
     v122 = v40;
     ODM_GetFloorLevel(_angle_x, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, 0);
     v129 = ODM_GetFloorLevel(_angle_x, pY, v40, pParty->uPartyHeight, &is_on_water, &v97, 0);
-    auto v119 = ODM_GetFloorLevel(pX, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &v110, 0);
+    int v119 = ODM_GetFloorLevel(pX, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &v110, 0);
     pModel = (BSPModel *)IsTerrainSlopeTooHigh(_angle_x, pY);
     v42 = IsTerrainSlopeTooHigh(pX, _angle_y);
     is_not_on_bmodel = false;
@@ -3703,7 +3703,7 @@
   if (!uNumActions)
     return PARTY_INVALID;
 
-  auto result = pActions[0];
+  PartyAction result = pActions[0];
   for (unsigned int i = 0; i < uNumActions - 1; ++i)
     pActions[i] = pActions[i + 1];
   --uNumActions;
@@ -4170,7 +4170,7 @@
   signed int v9; // [sp+Ch] [bp-8h]@1
   float v10; // [sp+10h] [bp-4h]@2
 
-  auto a1 = this;
+  stru6_stru1_indoor_sw_billboard* a1 = this;
 
   v1 = 0;
   v2 = a1;
@@ -4230,7 +4230,7 @@
   int a6; // [sp+3Ch] [bp-8h]@5
   int a5; // [sp+40h] [bp-4h]@5
 
-  auto a1 = this;
+  stru6_stru1_indoor_sw_billboard* a1 = this;
 
   v16 = 0;
   if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
@@ -4437,7 +4437,7 @@
     *out_height = 0;
 
   DWORD w;
-  auto  file = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr);
+  void*  file = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr);
   if (file == INVALID_HANDLE_VALUE)
     return nullptr;
 
@@ -4452,7 +4452,7 @@
   }
 
   int imgSize = header.tgaWidth * header.tgaHeight * 3;
-  auto pixels = new unsigned char[imgSize];
+  unsigned char* pixels = new unsigned char[imgSize];
   ReadFile(file, pixels, imgSize, &w, nullptr);
   CloseHandle(file);
 
@@ -4467,7 +4467,7 @@
   if (out_height)
     *out_height = header.tgaHeight;
 
-  auto pixels_16bit = new unsigned short[imgSize / 3];
+  unsigned short* pixels_16bit = new unsigned short[imgSize / 3];
   for (int i = 0; i < imgSize / 3; ++i)
   {
     pixels_16bit[i] = (pixels[i * 3] / 8 & 0x1F) |
@@ -4936,7 +4936,7 @@
       //v12 = 0;
       //while ( 1 )
       //{
-      auto spawn = pOutdoor->pSpawnPoints + i;
+      SpawnPointMM7* spawn = pOutdoor->pSpawnPoints + i;
         //v6 = &pOutdoor->pSpawnPoints[v12 / 0x18];
       if (spawn->uKind == 3 )
         SpawnEncounter(v4, spawn, 0, 0, 0);
@@ -5326,28 +5326,28 @@
 
   //v12 = a1;
   //v11 = a2;
-  auto grid_x = WorldPosToGridCellX(pos_x);
-  auto grid_z = WorldPosToGridCellZ(pos_z) - 1;
-
-  auto party_grid_x1 = GridCellToWorldPosX(grid_x);
+  unsigned int grid_x = WorldPosToGridCellX(pos_x);
+  unsigned int grid_z = WorldPosToGridCellZ(pos_z) - 1;
+
+  int party_grid_x1 = GridCellToWorldPosX(grid_x);
   //dword_76D56C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(grid_x + 1);
   //dword_76D570_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(grid_x + 1);
   //dword_76D574_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(grid_x);
-  auto party_grid_z1 = GridCellToWorldPosZ(grid_z);
+  int party_grid_z1 = GridCellToWorldPosZ(grid_z);
   //dword_76D55C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(grid_z);
   //dword_76D560_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(grid_z + 1);
   //dword_76D564_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(grid_z + 1);
-  auto party_x1z1_y = pOutdoor->DoGetHeightOnTerrain(grid_x, grid_z);
-  auto party_x2z1_y = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z);
-  auto party_x2z2_y = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z + 1);
-  auto party_x1z2_y = pOutdoor->DoGetHeightOnTerrain(grid_x, grid_z + 1);
+  int party_x1z1_y = pOutdoor->DoGetHeightOnTerrain(grid_x, grid_z);
+  int party_x2z1_y = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z);
+  int party_x2z2_y = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z + 1);
+  int party_x1z2_y = pOutdoor->DoGetHeightOnTerrain(grid_x, grid_z + 1);
   //dword_76D554_terrain_cell_world_pos_around_party_y = v4;
   if (party_x1z1_y == party_x2z1_y &&
       party_x2z1_y == party_x2z2_y &&
       party_x2z2_y == party_x1z2_y )
     return false;
 
-  auto dx = abs(pos_x - party_grid_x1),
+  int dx = abs(pos_x - party_grid_x1),
        dz = abs(party_grid_z1 - pos_z);
 
   int y1, y2, y3;
@@ -5420,15 +5420,15 @@
 
   //v11 = a1;
   //v12 = a2;
-  auto grid_x = WorldPosToGridCellX(a1);
-  auto grid_z = WorldPosToGridCellZ(a2) - 1;
-
-  auto grid_x1 = GridCellToWorldPosX(grid_x),
+  unsigned int grid_x = WorldPosToGridCellX(a1);
+  unsigned int grid_z = WorldPosToGridCellZ(a2) - 1;
+
+  int grid_x1 = GridCellToWorldPosX(grid_x),
        grid_x2 = GridCellToWorldPosX(grid_x + 1);
-  auto grid_z1 = GridCellToWorldPosZ(grid_z),
+  int grid_z1 = GridCellToWorldPosZ(grid_z),
        grid_z2 = GridCellToWorldPosZ(grid_z + 1);
 
-  auto y_x1z1 = pOutdoor->DoGetHeightOnTerrain(grid_x,     grid_z),
+  int y_x1z1 = pOutdoor->DoGetHeightOnTerrain(grid_x,     grid_z),
        y_x2z1 = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z),
        y_x2z2 = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z + 1),
        y_x1z2 = pOutdoor->DoGetHeightOnTerrain(grid_x,     grid_z + 1);
@@ -6039,9 +6039,9 @@
 
 	for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
 	{
-		auto pEvent = pLevelEVT_Index[i];
-
-		auto _evt = (_evt_raw *)(&pLevelEVT[pEvent.uEventOffsetInEVT]);
+		EventIndex pEvent = pLevelEVT_Index[i];
+
+		_evt_raw* _evt = (_evt_raw *)(&pLevelEVT[pEvent.uEventOffsetInEVT]);
 
 		if (_evt->_e_type == EVENT_PlaySound)
 		{
@@ -6115,8 +6115,8 @@
 				v16 = (signed int)(v14 / 4);
 				years = v16 / 12;
 
-				auto _1 = (unsigned __int64)((double)pParty->uTimePlayed * 0.234375) >> 32;
-				auto _2 = ((__int64)v9 << 32) | _1;
+				unsigned __int64 _1 = (unsigned __int64)((double)pParty->uTimePlayed * 0.234375) >> 32;
+				__int64 _2 = ((__int64)v9 << 32) | _1;
 
 				seconds = _2 % 60;
 				//v19 = (signed __int64)__PAIR__((unsigned __int64)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) >> 32,
@@ -6615,7 +6615,7 @@
   if (__unused)
     _5773C0_unused = 0;
   
-  auto v13 = (signed __int64)(pParty->uTimePlayed - _5773B8_event_timer) / 128;
+  long long v13 = (signed __int64)(pParty->uTimePlayed - _5773B8_event_timer) / 128;
   if (!v13)
     return;
 
@@ -6628,7 +6628,7 @@
   for (uint i = 0; i < dword_5B65C8_timers_count; ++i)
   {
         //v4 = (char *)&array_5B5928_timers[0].field_C;
-    auto timer = array_5B5928_timers + i;
+    stru176* timer = &array_5B5928_timers[i];
         //while ( 1 )
         //{
           //v5 = *(short *)v4;
--- a/mm7_4.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/mm7_4.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -727,7 +727,7 @@
       if ( v21->HasItemEquipped(v22) )
       {
         //v23 = v21->pEquipment.pIndices;
-        auto _idx = v21->pEquipment.pIndices[v22];
+        uint _idx = v21->pEquipment.pIndices[v22];
         v24 = v21->pInventoryItemList[_idx].uItemID;
         if ( v24 > 134 )
         {
@@ -1326,7 +1326,7 @@
 
   for (uint i = 0; i < 2; ++i)
   {
-    auto pBuf = &pParty->pPartyBuffs[dword_4EE07C[i]];
+    SpellBuff* pBuf = &pParty->pPartyBuffs[dword_4EE07C[i]];
     if (pBuf->uExpireTime == 0)
       continue;
 
@@ -1525,7 +1525,7 @@
   FILE *v2; // eax@1
   FILE *v3; // edi@1
 
-  auto Str = this;
+  PlayerFrameTable* Str = this;
 
   v1 = Str;
   v2 = fopen("data\\dpft.bin", "wb");
@@ -1781,7 +1781,7 @@
     npc = GetNPCData(sDialogue_SpeakingActorNPC_ID);
 
   //pText = a4;
-  auto len = strlen(lpsz);
+  uint len = strlen(lpsz);
   for (int i = 0, dst = 0; i < len; ++i)
   {
     char c = lpsz[i];
@@ -1968,7 +1968,7 @@
           break;
         case 17://  
         {
-          auto pay_percentage = pNPCStats->pProfessions[npc->uProfession - 1].uHirePrice / 100;
+          uint pay_percentage = pNPCStats->pProfessions[npc->uProfession - 1].uHirePrice / 100;
           if ( !pay_percentage )
             pay_percentage = 1;
           sprintf(a1, "%lu", pay_percentage);
@@ -2581,8 +2581,8 @@
             pDst[x] = pRenderer->uTargetRMask | pRenderer->uTargetBMask;
         }*/
         
-        auto pSrc = pRenderer->pTargetSurface;
-        auto pDst = (__int16 *)Dst.lpSurface;
+        ushort* pSrc = pRenderer->pTargetSurface;
+        short* pDst = (__int16 *)Dst.lpSurface;
 
         for (uint y = 0; y < 8; ++y)
           memcpy(pDst + y * Dst.lPitch / 2,
@@ -2602,9 +2602,9 @@
                  pSrc + y * 640, 640 * sizeof(__int16));
 
 
-        auto pSrc_x1y1 = pSrc + 640 * pViewport->uViewportTL_Y + pViewport->uViewportTL_X;
+        ushort* pSrc_x1y1 = pSrc + 640 * pViewport->uViewportTL_Y + pViewport->uViewportTL_X;
         //_this = (unsigned int)&pSrc[2 * (((signed int)pViewport->uViewportX >> 1) + 320 * pViewport->uViewportY)];
-        auto pDst_x1y1 = pDst + Dst.lPitch * pViewport->uViewportTL_Y + pViewport->uViewportTL_X;
+        short* pDst_x1y1 = pDst + Dst.lPitch * pViewport->uViewportTL_Y + pViewport->uViewportTL_X;
         //v23 = (unsigned __int32)((char *)v26 + 4 * (((signed int)pViewport->uViewportX >> 1) + (Dst.lPitch >> 2) * pViewport->uViewportY));
         v9 = ((signed int)pViewport->uViewportTL_X >> 1) - ((signed int)pViewport->uViewportBR_X >> 1);
         //v20 = ((signed int)pViewport->uViewportZ >> 1) - ((signed int)pViewport->uViewportX >> 1);
@@ -2615,7 +2615,7 @@
         //v26 = (LPVOID)(pViewport->uViewportW - pViewport->uViewportY + 1);
         v10 = (int)pSrc_x1y1;
         v11 = (int)pDst_x1y1;
-        auto uHalfWidth = v20 = (pViewport->uViewportBR_X - pViewport->uViewportTL_X) / 2;
+        int uHalfWidth = v20 = (pViewport->uViewportBR_X - pViewport->uViewportTL_X) / 2;
         v13 = v24;
 
         for (uint y = pViewport->uViewportTL_Y; y < pViewport->uViewportBR_Y + 1; ++y)
--- a/mm7_5.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/mm7_5.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -159,8 +159,8 @@
         else
         {
           v13 = &pActors[v7];
-          if ( SHIDWORD(v13->pActorBuffs[6].uExpireTime) > 0
-            || SHIDWORD(v13->pActorBuffs[6].uExpireTime) >= 0 && LODWORD(v13->pActorBuffs[6].uExpireTime)
+          if ( SHIDWORD(v13->pActorBuffs[ACTOR_BUFF_PARALYZED].uExpireTime) > 0
+            || SHIDWORD(v13->pActorBuffs[ACTOR_BUFF_PARALYZED].uExpireTime) >= 0 && LODWORD(v13->pActorBuffs[ACTOR_BUFF_PARALYZED].uExpireTime)
             || v13->CanAct() )
           {
             v14 = v13->vPosition.y;
@@ -283,7 +283,7 @@
 //----- (0043A97E) --------------------------------------------------------
 void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2)
 {
-  if (PID_TYPE(a2) == OBJECT_BLVDoor)
+  if (PID_TYPE(a2) == OBJECT_Player)
   {
     layingitem_vel_50FDFC.x = pSpriteObjects[uLayingItemID].vVelocity.x;
     layingitem_vel_50FDFC.y = pSpriteObjects[uLayingItemID].vVelocity.y;
@@ -440,28 +440,28 @@
       v7->uLastCharacterIDToHit = v17;
       if ( v9 )
         BYTE2(v7->uAttributes) |= 2u;
-      v6 = stru_50C198._4273BB(v8, v7, v4, 0);
+      v6 = v8->_4273BB_DoesHitOtherActor(v7, v4, 0);
       if ( v6 )
       {
         v10 = (unsigned int)v8->_43B3E0_CalcDamage(a4);
-        if ( (signed __int64)v8->pActorBuffs[3].uExpireTime > 0 )
+        if ( (signed __int64)v8->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime > 0 )
         {
-          v11 = v8->pActorBuffs[3].uPower;
+          v11 = v8->pActorBuffs[ACTOR_BUFF_SHRINK].uPower;
           if ( v11 )
             v10 = (signed int)v10 / (unsigned __int16)v11;
         }
-        if ( SHIDWORD(v7->pActorBuffs[5].uExpireTime) >= SHIDWORD(v10)
-          && (SHIDWORD(v7->pActorBuffs[5].uExpireTime) > SHIDWORD(v10)
-           || LODWORD(v7->pActorBuffs[5].uExpireTime) > HIDWORD(v10)) )
+        if ( SHIDWORD(v7->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime) >= SHIDWORD(v10)
+          && (SHIDWORD(v7->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime) > SHIDWORD(v10)
+           || LODWORD(v7->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime) > HIDWORD(v10)) )
           LODWORD(v10) = 0;
         if ( a4 != HIDWORD(v10) )
         {
           if ( a4 - HIDWORD(v10) == 1 )
           {
             v12 = v8->pMonsterInfo.uAttack2Type;
-            if ( SHIDWORD(v7->pActorBuffs[15].uExpireTime) >= SHIDWORD(v10)
-              && (SHIDWORD(v7->pActorBuffs[15].uExpireTime) > SHIDWORD(v10)
-               || LODWORD(v7->pActorBuffs[15].uExpireTime) > HIDWORD(v10)) )
+            if ( SHIDWORD(v7->pActorBuffs[ACTOR_BUFF_SHIELD].uExpireTime) >= SHIDWORD(v10)
+              && (SHIDWORD(v7->pActorBuffs[ACTOR_BUFF_SHIELD].uExpireTime) > SHIDWORD(v10)
+               || LODWORD(v7->pActorBuffs[ACTOR_BUFF_SHIELD].uExpireTime) > HIDWORD(v10)) )
               LODWORD(v10) = (signed int)v10 >> 1;
             goto LABEL_30;
           }
@@ -525,7 +525,7 @@
 {
   for (uint i = 0; i < uNumBillboardsToDraw; ++i)
   {
-    auto p = &pBillboardRenderList[i];
+    RenderBillboard* p = &pBillboardRenderList[i];
 
     if (p->field_1E & 2 || uCurrentlyLoadedLevelType == LEVEL_Indoor && !p->uIndoorSectorID)
       p->dimming_level = 0;
@@ -593,15 +593,15 @@
   v6 = uBaseLightLevel;
   for (uint i = 0; i < pMobileLightsStack->uNumLightsActive; ++i)
   {
-    auto p = pMobileLightsStack->pLights + i;
+    MobileLight* p = &pMobileLightsStack->pLights[i];
 
-      auto distX = abs(p->vPosition.x - x);
+      float distX = abs(p->vPosition.x - x);
       if ( distX <= p->uRadius)
       {
-        auto distY = abs(p->vPosition.y - y);
+        float distY = abs(p->vPosition.y - y);
         if ( distY <= p->uRadius)
         {
-          auto distZ = abs(p->vPosition.z - z);
+          float distZ = abs(p->vPosition.z - z);
           if ( distZ <= p->uRadius)
           {
             v8 = distX;
@@ -635,7 +635,7 @@
 
   if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
   {
-    auto pSector = pIndoor->pSectors + uSectorID;
+    BLVSector* pSector = &pIndoor->pSectors[uSectorID];
 
     for (uint i = 0; i < pSector->uNumLights; ++i)
     {
@@ -685,7 +685,7 @@
 
   for (uint i = 0; i < pStationaryLightsStack->uNumLightsActive; ++i)
   {
-    auto p = pStationaryLightsStack->pLights + i;
+    StationaryLight* p = &pStationaryLightsStack->pLights[i];
       v26 = abs(p->vPosition.x - x);
       if ( v26 <= p->uRadius)
       {
--- a/mm7_6.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/mm7_6.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -42,349 +42,7 @@
 
 
 
-//----- (00426A5A) --------------------------------------------------------
-void stru319::LootActor(Actor *pActor)
-{
-  signed int v2; // edi@1
-  char v3; // zf@1
-  unsigned int v4; // eax@13
-  unsigned int v5; // esi@13
-  int v6; // eax@14
-  unsigned __int8 v7; // al@30
-  Party *v8; // esi@34
-  char *v9; // [sp-4h] [bp-3Ch]@10
-  char *v10; // [sp-4h] [bp-3Ch]@31
-  char *v11; // [sp-4h] [bp-3Ch]@38
-  ItemGen Dst; // [sp+Ch] [bp-2Ch]@1
-  int v13; // [sp+30h] [bp-8h]@1
-  int v14; // [sp+34h] [bp-4h]@1
 
-  pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
-  Dst.Reset();
-  v2 = 0;
-  v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0;
-  v13 = 0;
-  v14 = 0;
-  if ( v3 )
-  {
-    if ( pActor->pMonsterInfo.uTreasureDiceRolls )
-    {
-		do
-		{
-		  ++v2;
-		  v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1;
-		}
-		while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls );
-		if ( v14 )
-		{
-		  pParty->PartyFindsGold(v14, 0);
-		  viewparams->bRedrawGameUI = 1;
-		}
-	}
-  }
-  else
-  {
-    if ( pActor->array_000234[3].uItemID != 0 &&  pActor->array_000234[3].GetItemEquipType() == 18 )
-	{
-		v14 = pActor->array_000234[3].uSpecEnchantmentType;
-		pActor->array_000234[3].Reset();
-		if ( v14 )
-		{
-		  pParty->PartyFindsGold(v14, 0);
-		  viewparams->bRedrawGameUI = 1;
-		}
-	}
-  }
-  if ( pActor->uCarriedItemID )
-  {
-    Dst.Reset();
-    Dst.uItemID = pActor->uCarriedItemID;
-    v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
-    if ( v14 )
-      sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v9);
-    else
-      sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v9);
-    ShowStatusBarString(pTmpBuf2.data(), 2u);
-    v4 = Dst.uItemID;
-    v5 = Dst.uItemID;
-    if ( Dst.GetItemEquipType() == 12 )
-    {
-      v5 = Dst.uItemID;
-      v6 = rand() % 6 + Dst.GetDamageMod() + 1;
-      Dst.uNumCharges = v6;
-      Dst.uMaxCharges = v6;
-      v4 = Dst.uItemID;
-    }
-    if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 )
-      Dst.uEnchantmentType = 2 * rand() % 4 + 2;
-    pItemsTable->SetSpecialBonus(&Dst);
-    if ( !pParty->AddItemToParty(&Dst) )
-      pParty->SetHoldingItem(&Dst);
-    pActor->uCarriedItemID = 0;
-    if ( pActor->array_000234[0].uItemID )
-    {
-      if ( !pParty->AddItemToParty(pActor->array_000234) )
-      {
-        pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
-        pParty->SetHoldingItem(pActor->array_000234);
-      }
-      pActor->array_000234[0].Reset();
-    }
-    if ( pActor->array_000234[1].uItemID )
-    {
-      if ( !pParty->AddItemToParty(&pActor->array_000234[1]) )
-      {
-        pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
-        pParty->SetHoldingItem(&pActor->array_000234[1]);
-      }
-      pActor->array_000234[1].Reset();
-    }
-    pActor->Remove();
-    return;
-  }
-  if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes )
-  {
-    if ( pActor->array_000234[3].uItemID )
-    {
-      memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst));
-      pActor->array_000234[3].Reset();
-      v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
-      if ( v14 )
-        sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v11);
-      else
-        sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v11);
-      ShowStatusBarString(pTmpBuf2.data(), 2u);
-      if ( !pParty->AddItemToParty(&Dst) )
-        pParty->SetHoldingItem(&Dst);
-      v13 = 1;
-    }
-    v8 = pParty;
-    goto LABEL_45;
-  }
-  if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 )
-  {
-    v8 = pParty;
-    goto LABEL_45;
-  }
-  pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst);
-  v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
-  if ( v14 )
-    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10);//  ^I[%d] ^L[;;]   (%s)!
-  else
-    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10);//  ^Pv[%s]!
-  ShowStatusBarString(pTmpBuf2.data(), 2);
-  v8 = pParty;
-  if ( !pParty->AddItemToParty(&Dst) )
-    pParty->SetHoldingItem(&Dst);
-  v13 = 1;
-LABEL_45:
-  if ( pActor->array_000234[0].uItemID )
-  {
-    if ( !v8->AddItemToParty(pActor->array_000234) )
-    {
-      pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
-      v8->SetHoldingItem(pActor->array_000234);
-      v13 = 1;
-    }
-    pActor->array_000234[0].Reset();
-  }
-  if ( pActor->array_000234[1].uItemID )
-  {
-    if ( !v8->AddItemToParty(&pActor->array_000234[1]) )
-    {
-      pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
-      v8->SetHoldingItem(&pActor->array_000234[1]);
-      v13 = 1;
-    }
-    pActor->array_000234[1].Reset();
-  }
-  if ( !v13 || rand() % 100 < 90 )
-  {
-    pActor->Remove();
-  }
-}
-//----- (0042704B) --------------------------------------------------------
-int stru319::special_ability_use_check( struct Actor *pActor, int a2 )
-    {
-  stru319 *v3; // edi@1
-  signed int v4; // ebx@5
-  signed int v5; // edi@5
-
-  v3 = this;
-  if ( pActor->pMonsterInfo.uSpecialAbilityType == 2
-    && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u
-    && rand() % 100 < 5 )
-    pActor->SummonMinion(a2);
-  v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID);
-  v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID);
-  if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance )
-    return 2;
-  if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance )
-    return 3;
-  return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance?1:0;
-}
-
-//----- (00427102) --------------------------------------------------------
-int stru319::_427102(Actor *pActor, signed int a2)
-{
-  unsigned __int8 v3; // cf@11
-  unsigned __int8 v4; // zf@11
-  SpellBuff *v6; // ecx@46
-  Player *v7; // esi@49
-  signed int v8; // edx@50
-  SpellBuff *v9; // ecx@50
-
-  switch(a2)
-  {
-	case 77:
-		{
-		if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP )
-			return 0;
-		return 1;
-		}
-	case 80:
-		{
-		v6 = pParty->pPartyBuffs.data();
-		while ( (signed __int64)v6->uExpireTime <= 0 )
-		{
-			++v6;
-			if ( v6 > &pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE] )
-			{
-				v7 = pParty->pPlayers.data();//[0].pPlayerBuffs;
-				v8 = 0;
-				v9 = v7->pPlayerBuffs.data();
-				while ( v9->uExpireTime <= 0i64 )
-				{
-					++v8;
-					++v9;
-					if ( v8 >= 24 )
-					{
-						++v7;
-						if ( v7 <= &pParty->pPlayers[3] )
-						{
-							v8 = 0;
-							v9 = v7->pPlayerBuffs.data();
-						}
-						else
-							return 0;
-					}
-				}
-				return 1;
-			}
-		}
-		return 1;
-		}
-	case 85:
-		{
-		if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 )
-			return 1;
-		if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 )
-			return 0;
-		v3 = 0;
-		v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0;
-		break;
-		}
-	case 86:
-		{
-        if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 )
-			return 1;
-        if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 )
-			return 0;
-        v3 = 0;
-        v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0;
-		break;
-		}
-	case 95:
-		{
-        if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 )
-			return 1;
-        if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 )
-			return 0;
-        v3 = 0;
-        v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0;
-		break;
-		}
-	case 73:
-		{
-		if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 )
-			return 1;
-		if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 )
-			return 0;
-		v3 = 0;
-		v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0;
-		break;
-		}
-	case 5:
-		{
-		if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 )
-			return 1;
-		if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 )
-			return 0;
-		v3 = 0;
-		v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0;
-		break;
-		}
-	case 17:
-		{
-		if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 )
-			return 1;
-		if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 )
-			return 0;
-		v3 = 0;
-		v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0;
-		break;
-		}
-	case 38:
-		{
-		if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 )
-			return 1;
-		if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 )
-			return 0;
-		v3 = 0;
-		v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0;
-		}
-	case 46:
-		{
-		if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 )
-			return 1;
-		if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 )
-			return 0;
-		v3 = 0;
-		v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0;
-		break;
-		}
-	case 47:
-		{
-		if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 )
-			return 1;
-		if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 )
-			return 0;
-		v3 = 0;
-		v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0;
-		break;
-		}
-	case 51:
-		{
-		if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 )
-			return 1;
-		if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 )
-		{
-			v3 = 0;
-			v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0;
-		}
-		else
-			return 0;
-		break;
-		}
-	default:
-		{
-		return 1;
-		}
-  }
-  if ( !(v3 | v4) )
-    return 0;
-  return 1;
-}
 
 //----- (004272F5) --------------------------------------------------------
 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4)
@@ -404,12 +62,12 @@
 
   v5 = pActor->pMonsterInfo.uAC;
   v6 = 0;
-  if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 )
+  if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime > 0 )
     v5 /= 2;
-  if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
-    v6 = pActor->pActorBuffs[15].uPower;
-  if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 )
-    v6 = pActor->pActorBuffs[16].uPower;
+  if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 )
+    v6 = pActor->pActorBuffs[ACTOR_BUFF_SHIELD].uPower;
+  if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uExpireTime > 0 && pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower > v6 )
+    v6 = pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower;
   v7 = v6 + v5;
   if ( a3 )
     v8 = pPlayer->GetRangedAttack();
@@ -447,42 +105,6 @@
   return result;
 }
 
-//----- (004273BB) --------------------------------------------------------
-bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4)
-{
-  Actor *v5; // ecx@1
-  signed int v6; // ebx@1
-  signed int v7; // esi@1
-  unsigned __int8 v8; // zf@1
-  unsigned __int8 v9; // sf@1
-  int v10; // ebx@10
-  signed int a2a; // [sp+18h] [bp+Ch]@1
-
-  v5 = a2;
-  v6 = a2->pMonsterInfo.uAC;
-  v7 = 0;
-  v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0;
-  v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0;
-  a2a = 0;
-  if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) )
-    v6 /= 2;
-  if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 )
-    v7 = v5->pActorBuffs[14].uPower;
-  if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 )
-    v7 = v5->pActorBuffs[16].uPower;
-  v10 = v7 + v6;
-  if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
-    a2a = pActor->pActorBuffs[14].uPower;
-  if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a )
-    a2a = pActor->pActorBuffs[17].uPower;
-  if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 )
-  {
-    a2a += pActor->pActorBuffs[11].uPower;
-    pActor->pActorBuffs[11].Reset();
-  }
-  return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5;
-}
-
 //----- (004274AD) --------------------------------------------------------
 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer)
 {
@@ -491,14 +113,14 @@
   int v5; // esi@8
 
   v3 = 0;
-  if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
-    v3 = pActor->pActorBuffs[14].uPower;
-  if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 )
-    v3 = pActor->pActorBuffs[17].uPower;
-  if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 )
+  if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 )
+    v3 = pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower;
+  if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_BLESS].uExpireTime > 0 && pActor->pActorBuffs[ACTOR_BUFF_BLESS].uPower > v3 )
+    v3 = pActor->pActorBuffs[ACTOR_BUFF_BLESS].uPower;
+  if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_FATE].uExpireTime > 0 )
   {
-    v3 += pActor->pActorBuffs[11].uPower;
-    pActor->pActorBuffs[11].Reset();
+    v3 += pActor->pActorBuffs[ACTOR_BUFF_FATE].uPower;
+    pActor->pActorBuffs[ACTOR_BUFF_FATE].Reset();
   }
   v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10;
   v5 = rand() % v4 + 1;
@@ -535,8 +157,8 @@
 
   v4 = 0;
   v5 = 0;
-  if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
-    v5 = pActor->pActorBuffs[14].uPower;
+  if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 )
+    v5 = pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower;
   switch ( a2 )
   {
     case 0:
@@ -718,7 +340,7 @@
   //v27 = 6972 * uActiveCharacter;
   //v1 = &pParty->pPlayers[uActiveCharacter-1];
   //result = pParty->pPlayers[uActiveCharacter-1].CanAct();
-  auto player = &pParty->pPlayers[uActiveCharacter - 1];
+  Player* player = &pParty->pPlayers[uActiveCharacter - 1];
   if (!player->CanAct())
     return;
 
@@ -741,7 +363,7 @@
   int main_hand_idx = player->pEquipment.uMainHand;
   if (main_hand_idx)
   {
-    auto item = &player->pInventoryItemList[main_hand_idx - 1];
+    ItemGen* item = &player->pInventoryItemList[main_hand_idx - 1];
       //v5 = (char *)v1 + 36 * v4;
     if (!item->IsBroken())
     {
@@ -774,7 +396,7 @@
     target_id = PID_ID(target_pid);
   }
 
-  auto actor = &pActors[target_id];
+  Actor* actor = &pActors[target_id];
   int actor_distance = 0;
   if (target_type == OBJECT_Actor)
   {
@@ -1370,7 +992,7 @@
   int v24; // [sp+4h] [bp-4h]@87
 
   pGame->pKeyboardInstance->EnterCriticalSection();
-  auto pKeyboard = pGame->pKeyboardInstance;
+  Keyboard* pKeyboard = pGame->pKeyboardInstance;
   if (!bAlwaysRun)
   {
     if (pKeyboard->IsShiftHeld())
--- a/mm7_data.h	Fri Nov 01 14:43:54 2013 +0600
+++ b/mm7_data.h	Fri Nov 01 14:44:06 2013 +0600
@@ -1342,7 +1342,7 @@
 inline int round(float x) { return (int)floor(x + 0.5f); }
 inline void __fastcall memset32(void *ptr, unsigned __int32 value, int count)
 {
-  auto p = (unsigned __int32 *)ptr;
+  unsigned __int32* p = (unsigned __int32 *)ptr;
   for ( int i=0; i < count; i++ )
     *p++ = value;
 }
--- a/stru6.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/stru6.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -192,7 +192,7 @@
   
   for (uint i = 0; i < uNumProjectiles; ++i)
   {
-    auto p = pProjectiles + i;
+    ProjectileAnim* p = &pProjectiles[i];
 
     v[0].vWorldPosition.x = p->srcX;
     v[0].vWorldPosition.y = p->srcY;
@@ -735,12 +735,12 @@
   float v5; // ST00_4@6
 
   v2 = (int)pActor;
-  v3 = LODWORD(pActor->pActorBuffs[10].uExpireTime) - pMiscTimer->uTotalGameTimeElapsed;
+  v3 = LODWORD(pActor->pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].uExpireTime) - pMiscTimer->uTotalGameTimeElapsed;
   if ( (signed int)v3 <= 64 )
   {
     if ( (v3 & 0x80000000u) != 0 )
     {
-      pActor->pActorBuffs[10].uExpireTime = 0i64;
+      pActor->pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].uExpireTime = 0i64;
       v4 = 1.0;
     }
     else
@@ -1581,7 +1581,7 @@
 {
   for (uint i = 0; i < 4; ++i)
   {
-    auto buff = pPlayerBuffs + i;
+    PlayerBuffAnim* buff = &pPlayerBuffs[i];
     if (!buff->bRender)
       continue;
 
@@ -1592,7 +1592,7 @@
       continue;
     }
 
-    auto icon = pIconsFrameTable->GetFrame(buff->uSpellIconID, buff->uSpellAnimTimeElapsed);
+    IconFrame* icon = pIconsFrameTable->GetFrame(buff->uSpellIconID, buff->uSpellAnimTimeElapsed);
     pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 385, pIcons_LOD->GetTexture(icon->uTextureID));
 
     pOtherOverlayList->bRedraw = true;
--- a/stru9.cpp	Fri Nov 01 14:43:54 2013 +0600
+++ b/stru9.cpp	Fri Nov 01 14:44:06 2013 +0600
@@ -194,7 +194,7 @@
   //v9 = a1;
   //v10 = a5;
   //v11 = (char *)&a1->vWorldPosition.z;
-  auto pLineStart = &a1[0];
+  RenderVertexSoft* pLineStart = &a1[0];
   //pVertices = a3;
   pLinelength1 = a5->x * a1[0].vWorldPosition.x + a1[0].vWorldPosition.y * a5->y + a1[0].vWorldPosition.z * a5->z;
   //v20 = v13;