changeset 1205:8c02e6f74b29

arrays to std::arrays phase 2 - mm7_data.h converted
author Grumpy7
date Sun, 09 Jun 2013 00:30:48 +0200
parents 832f09144726
children ab6560001f5b
files Actor.cpp Arcomage.cpp AudioPlayer.cpp Chest.cpp Events.cpp GUIFont.cpp GUIWindow.cpp Game.cpp Indoor.cpp Items.cpp LightmapBuilder.cpp Monsters.cpp Outdoor.cpp Party.cpp Player.cpp Render.cpp SaveLoad.cpp Spells.cpp SpriteObject.cpp Texture.cpp UIBooks.cpp UICharacter.cpp UIHouses.cpp UIMainMenu.cpp UIOptions.cpp UIPartyCreation.cpp UIPopup.cpp UIRest.cpp UISaveLoad.cpp UITransition.cpp UiGame.cpp VideoPlayer.cpp Vis.cpp mm7_1.cpp mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_5.cpp mm7_6.cpp mm7_data.cpp mm7_data.h
diffstat 41 files changed, 1291 insertions(+), 1291 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Actor.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -2354,7 +2354,7 @@
   {
     pCastSpellInfo.data()->_427D48(v1);
     v4 = 0;
-    v5 = pMapStats->GetMapInfo(pCurrentMapName);
+    v5 = pMapStats->GetMapInfo(pCurrentMapName.data());
     if ( v5 )
       v4 = pMapStats->pInfos[v5]._steal_perm;
     v6 = &pOutdoor->ddm;
--- a/Arcomage.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Arcomage.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -3418,7 +3418,7 @@
     v12 = 0;
     if ( !am_byte_4FAA75 )
     {
-      v13 = (signed int)amuint_4FAA78;
+      v13 = (signed int)amuint_4FAA78.data();
       do
       {
         if ( *(unsigned int *)v13 == -1 )
--- a/AudioPlayer.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/AudioPlayer.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -2413,7 +2413,7 @@
 {
   unsigned int v0; // eax@1
 
-  v0 = pMapStats->GetMapInfo(pCurrentMapName);
+  v0 = pMapStats->GetMapInfo(pCurrentMapName.data());
   if ( v0 )
     pAudioPlayer->PlayMusicTrack((MusicID)pMapStats->pInfos[v0].uRedbookTrackID);
 }
@@ -2447,7 +2447,7 @@
   int v3; // [sp+4h] [bp-4h]@3
 
   v1 = this;
-  v2 = pMapStats->GetMapInfo(pCurrentMapName);
+  v2 = pMapStats->GetMapInfo(pCurrentMapName.data());
   if ( v1->b3DSoundInitialized && v1->bEAXSupported )
   {
     v3 = pMapStats->pInfos[v2].uEAXEnv;
@@ -2482,7 +2482,7 @@
   int v13; // [sp+20h] [bp-4h]@6
 
   v1 = this;
-  v2 = pMapStats->GetMapInfo(pCurrentMapName);
+  v2 = pMapStats->GetMapInfo(pCurrentMapName.data());
   v3 = v1->b3DSoundInitialized == 0;
   v4 = v2;
   v12 = v2;
--- a/Chest.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Chest.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -104,7 +104,7 @@
   if ( !uActiveCharacter )
     return 0;
   *(float *)&sRotY = 0.0;
-  v2 = pMapStats->GetMapInfo(pCurrentMapName);
+  v2 = pMapStats->GetMapInfo(pCurrentMapName.data());
   if ( !chest->Trapped() || !v2 )
     goto LABEL_12;
   if ( pPlayers[uActiveCharacter]->GetDisarmTrap() < 2 * pMapStats->pInfos[v2].LockX5 )
@@ -285,8 +285,8 @@
     chest_offs_y = pChestPixelOffsetY[chestBitmapId];
     chestWidthCells = pChestWidthsByType[chestBitmapId];
     chestHeghtCells = pChestHeightsByType[chestBitmapId];
-    sprintf(pTmpBuf, "chest%02d", pChestList->pChests[chestBitmapId].uTextureID);
-    v5 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE);
+    sprintf(pTmpBuf.data(), "chest%02d", pChestList->pChests[chestBitmapId].uTextureID);
+    v5 = pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
     pRenderer->DrawTextureIndexed(8u, 8u, pIcons_LOD->GetTexture(v5));
 
     for (item_counter = 0; item_counter< chestWidthCells * chestHeghtCells; ++item_counter)
--- a/Events.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Events.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -1108,7 +1108,7 @@
 			case EVENT_InputString:
 				if ( !entry_line )
 					{
-					strcpy(GameUI_Footer_TimedString, &pLevelStr[pLevelStrOffsets[EVT_DWORD(_evt->v5 )]]);
+					strcpy(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[EVT_DWORD(_evt->v5 )]]);
 					v105 = curr_seq_num;
 					v121 = 26;
 LABEL_295:
@@ -1119,8 +1119,8 @@
 					return;
 					}
 				v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
-				if ( !_stricmp(GameUI_Footer_TimedString, &pLevelStr[pLevelStrOffsets[_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]])
-					|| !_stricmp(GameUI_Footer_TimedString, &pLevelStr[pLevelStrOffsets[v84]]) )
+				if ( !_stricmp(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]])
+					|| !_stricmp(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[v84]]) )
 					{
 					v11 = _evt->v17;
 LABEL_130:
@@ -1290,7 +1290,7 @@
 					}
 				else
 					{
-					strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]);
+					strcpy(byte_5B0938.data(), &pLevelStr[pLevelStrOffsets[v92]]);
 					}
 				++curr_seq_num;
 				v4 = v124;
--- a/GUIFont.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/GUIFont.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -29,7 +29,7 @@
 
 char temp_string[2048];
 
-char pTmpBuf3[10000];
+std::array<char, 10000> pTmpBuf3;
 
 void DrawCharToBuff(unsigned short* uXpos,unsigned char* pCharPixels, int uCharWidth, int uCharHeight, unsigned __int16* pFontPalette, __int16 draw_color, int line_width);
 
@@ -50,8 +50,8 @@
         pallete_index =pIcons_LOD->LoadTexture(pFontPalette, TEXTURE_16BIT_PALETTE);
         if (pallete_index == -1)
             {
-            wsprintfA(pTmpBuf, "Unable to open %s", pFontPalette);
-            Abortf(pTmpBuf);
+            wsprintfA(pTmpBuf.data(), "Unable to open %s", pFontPalette);
+            Abortf(pTmpBuf.data());
             }	
         pFont->pFontPalettes[palletes_count] = pIcons_LOD->pTextures[pallete_index].pPalette16;
         ++palletes_count;
@@ -286,9 +286,9 @@
   currentFont=pFontMain; // esi@3
   uInStrLen = strlen(pString);
   assert(uInStrLen < sizeof(pTmpBuf3));
-  strcpy(pTmpBuf3, pString);
+  strcpy(pTmpBuf3.data(), pString);
   if (uInStrLen==0)
-      return pTmpBuf3;
+      return pTmpBuf3.data();
 
   start_pixel_offset=string_pixel_Width=startPixlOff;
   possible_transition_point=0;
@@ -379,7 +379,7 @@
               }
           }
       }
-  return pTmpBuf3;
+  return pTmpBuf3.data();
 
 }
 
--- a/GUIWindow.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/GUIWindow.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -242,7 +242,7 @@
   v20 = 0;
   GetTickCount();
   v8 = &_4E2B21_buff_spell_tooltip_colors[1];
-  v16 = aSpellNames;
+  v16 = aSpellNames.data();
   v18 = pParty->pPartyBuffs;
   do
   {
@@ -686,7 +686,7 @@
       v26.uFrameHeight = v2 * 264 / v2;
       v26.uFrameW = v26.uFrameHeight + 69;
       memset(&achieved_awards, 0, 4000);
-      memset(byte_5C6D50, 0, 0x64u);
+      memset(byte_5C6D50.data(), 0, 0x64u);
       if ( dword_506528 < 29 )
           {
           v3 = (__int64 *)&pParty->field_3C.field_4F0[2 * dword_506528];
@@ -1077,10 +1077,10 @@
   }
   else
   {
-    sprintfex( pTmpBuf, pGlobalTXT_LocalizationStrings[429],
+    sprintfex( pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429],
       p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName,
       p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle);
-    pWindow.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, pColor2, pTmpBuf, 3);
+    pWindow.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, pColor2, pTmpBuf.data(), 3);
       switch ( in_current_building_type )
       {
         case BildingType_WeaponShop:
@@ -1177,14 +1177,14 @@
   v17 = (signed __int64)__PAIR__(v2, v3) % 60;
   v16 = (signed __int64)__PAIR__(v4, v5) % 60;
   v7 = v6 % 24;
-  strcpy(pTmpBuf, pGlobalTXT_LocalizationStrings[532]);
+  strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[532]);
   if ( (unsigned int)v6 /24 )
   {
     v8 = pGlobalTXT_LocalizationStrings[57];
     if ( v18 <= 1 )
       v8 = pGlobalTXT_LocalizationStrings[56];
-    sprintf(pTmpBuf2, "%d %s ", v18, v8);
-    strcat(pTmpBuf, pTmpBuf2);
+    sprintf(pTmpBuf2.data(), "%d %s ", v18, v8);
+    strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
   if ( v7 )
   {
@@ -1192,8 +1192,8 @@
       v9 = pGlobalTXT_LocalizationStrings[109];
     else
       v9 = pGlobalTXT_LocalizationStrings[110];
-    sprintf(pTmpBuf2, "%d %s ", v7, v9);
-    strcat(pTmpBuf, pTmpBuf2);
+    sprintf(pTmpBuf2.data(), "%d %s ", v7, v9);
+    strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
   if ( v16 && !v18 )
   {
@@ -1201,8 +1201,8 @@
       v10 = pGlobalTXT_LocalizationStrings[437];//"Minute"
     else
       v10 = pGlobalTXT_LocalizationStrings[436]; //"Minutes"
-    sprintf(pTmpBuf2, "%d %s ", v16, v10);
-    strcat(pTmpBuf, pTmpBuf2);
+    sprintf(pTmpBuf2.data(), "%d %s ", v16, v10);
+    strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
   if ( v17 && !v7 )
   {
@@ -1210,12 +1210,12 @@
       v11 = pGlobalTXT_LocalizationStrings[439]; //"Second"	
     else
       v11 = pGlobalTXT_LocalizationStrings[438]; //"Seconds"
-    sprintf(pTmpBuf2, "%d %s ", v17, v11);
-    strcat(pTmpBuf, pTmpBuf2);
+    sprintf(pTmpBuf2.data(), "%d %s ", v17, v11);
+    strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
   v12 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-  v13 = pFontArrus->CalcTextHeight(pTmpBuf, v15, 0, 0);
-  v15->DrawTitleText(pFontArrus, 0, (212 - v13) / 2 + 101, v12, pTmpBuf, 3u);
+  v13 = pFontArrus->CalcTextHeight(pTmpBuf.data(), v15, 0, 0);
+  v15->DrawTitleText(pFontArrus, 0, (212 - v13) / 2 + 101, v12, pTmpBuf.data(), 3u);
 }
 
 
@@ -1462,10 +1462,10 @@
     pWindow->DrawText(pFont, uX, uY, uColor, Str1, 0, 0, 0);
     return pLineWidth;
   }
-  strcpy(pTmpBuf2, Str1);
+  strcpy(pTmpBuf2.data(), Str1);
   v11 = 0;
   if ( a8 )
-    _strrev(pTmpBuf2);
+    _strrev(pTmpBuf2.data());
   Str1a = 0;
   if ( (signed int)pNumLen > 0 )
   {
@@ -1509,10 +1509,10 @@
     while ( (signed int)Str1a < (signed int)pNumLen );
   }
   pTmpBuf2[Str1a - 1] = 0;
-  pNumLen = strlen(pTmpBuf2);
-  v28 = pFont->GetLineWidth(pTmpBuf2);
+  pNumLen = strlen(pTmpBuf2.data());
+  v28 = pFont->GetLineWidth(pTmpBuf2.data());
   if ( a8 )
-    _strrev(pTmpBuf2);
+    _strrev(pTmpBuf2.data());
   Str1b = 0;
   v13 = uX + pWindow->uFrameX;
   v14 = uY + pWindow->uFrameY;
@@ -1796,8 +1796,8 @@
                 pWindow->CreateButton(0x1E0u, 0x82u, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Du, 0, pGlobalTXT_LocalizationStrings[407], 0);//Подробнее
                 if (speakingNPC->Hired())
                 {
-                  sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], speakingNPC->pName); //Отпустить
-                  pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pTmpBuf, 0);
+                  sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[408], speakingNPC->pName); //Отпустить
+                  pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pTmpBuf.data(), 0);
                 }
                 else
                 {
@@ -1865,10 +1865,10 @@
           v30 = v27;
           v29 = (char*)pGlobalTXT_LocalizationStrings[435];
         }
-        sprintfex(byte_591180[v26], v29, v30);
+        sprintfex(byte_591180[v26].data(), v29, v30);
         HouseNPCData[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26],
                                                                  pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26],
-                                             0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26], 0, 0, 0);
+                                             0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26].data(), 0, 0, 0);
         v25 = uNumDialogueNPCPortraits;
       }
     }
--- a/Game.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Game.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -213,33 +213,33 @@
 
   if (render_framerate)
   {
-    sprintf(pTmpBuf, "FPS: % .4f", framerate);
-    pPrimaryWindow->DrawText(pFontArrus, 494, 0, TargetColor(0, 0, 0), pTmpBuf, 0, 0, 0);
+    sprintf(pTmpBuf.data(), "FPS: % .4f", framerate);
+    pPrimaryWindow->DrawText(pFontArrus, 494, 0, TargetColor(0, 0, 0), pTmpBuf.data(), 0, 0, 0);
   }
 
   if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
   {
     auto sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
-    sprintf(pTmpBuf, "Party Sector ID:        %u/%u\n", sector_id, pIndoor->uNumSectors);
-    pPrimaryWindow->DrawText(pFontArrus, 16, 16, TargetColor(255, 255, 255), pTmpBuf, 0, 0, 0xFFFFFFFF);
+    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);
   }
-  sprintf(pTmpBuf, "Party Position:         % d % d % d", pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
-  pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16, TargetColor(255, 255, 255), pTmpBuf, 0, 0, 0xFFFFFFFF);
+  sprintf(pTmpBuf.data(), "Party Position:         % d % d % d", pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
+  pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16, TargetColor(255, 255, 255), pTmpBuf.data(), 0, 0, 0xFFFFFFFF);
   
   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);
-    sprintf(pTmpBuf, "BLV_GetFloorLevel: %d   face_id %d\n", floor_level, 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);
-    sprintf(pTmpBuf, "ODM_GetFloorLevel: %d   on_water: %s    a6 = %d\n", floor_level, on_water ? "true" : "false", _a6);
+    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, 0, 0, 0xFFFFFFFF);
+  pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16 + 16, TargetColor(255, 255, 255), pTmpBuf.data(), 0, 0, 0xFFFFFFFF);
 
   GUI_UpdateWindows();
   pParty->UpdatePlayersAndHirelingsEmotions();
@@ -298,8 +298,8 @@
   for (uint i = 1; i < 5; ++i)
     for (uint j = 1; j < 6; ++j)
     {
-      sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", i, j);
-      remove(pTmpBuf);
+      sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j);
+      remove(pTmpBuf.data());
     }
 
   LoadPlayerPortraintsAndVoices();
@@ -514,9 +514,9 @@
       pParty->uFallSpeed = 0;
       pParty->field_6E4 = 0;
       pParty->field_6E0 = 0;
-      if ( _stricmp(Source, pCurrentMapName) )
+      if ( _stricmp(Source, pCurrentMapName.data()) )
       {
-        strcpy(pCurrentMapName, Source);
+        strcpy(pCurrentMapName.data(), Source);
         _5B65A8_npcdata_uflags_or_other = pParty->vPosition.x;
         _5B65AC_npcdata_fame_or_other = pParty->vPosition.y;
         _5B65B0_npcdata_rep_or_other = pParty->vPosition.z;
--- a/Indoor.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Indoor.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -78,7 +78,7 @@
 };
 
 
-const char *_4E6BDC_loc_names[11]=
+std::array<const char *, 11> _4E6BDC_loc_names=
     {
     "mdt12.blv",
     "d18.blv",
@@ -2785,7 +2785,7 @@
   if (dword_6BE364_game_settings_1 & 0x2000 )
     _i = 29030400;
   bool _a = false;
-  if ( a3 - dlv.uLastRepawnDay >= _i && _stricmp(pCurrentMapName, "d29.dlv") )
+  if ( a3 - dlv.uLastRepawnDay >= _i && _stricmp(pCurrentMapName.data(), "d29.dlv") )
     _a = true;
 
   //v154 = 875;
@@ -4322,7 +4322,7 @@
     bUnderwater = 1;
     pGame->uFlags2 |= 8u;
   }
-  if ( !_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d23.blv") )
+  if ( !_stricmp(pCurrentMapName.data(), "out15.odm") || !_stricmp(pCurrentMapName.data(), "d23.blv") )
     bNoNPCHiring = 1;
   pPaletteManager->pPalette_tintColor[0] = 0;
   pPaletteManager->pPalette_tintColor[1] = 0;
@@ -4330,7 +4330,7 @@
   pPaletteManager->RecalculateAll();
   if ( qword_A750D8 )
     qword_A750D8 = 0i64;
-  v2 = pMapStats->GetMapInfo(pCurrentMapName);
+  v2 = pMapStats->GetMapInfo(pCurrentMapName.data());
   v39 = v2;
   if ( v2 )
   {
@@ -4349,7 +4349,7 @@
   TryLoadLevelFromLOD();
   pStationaryLightsStack->uNumLightsActive = 0;
   v4 = pIndoor->Load(
-         pCurrentMapName,
+         pCurrentMapName.data(),
          (unsigned int)(signed __int64)((double)pParty->uTimePlayed * 0.234375) / 60 / 60 / 24 + 1,
          v1,
          (char *)&pDest)
--- a/Items.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Items.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -134,14 +134,14 @@
 const unsigned __int16 shopAlchSpc_treasure_lvl[13]   =  {0, 2, 2, 3, 3, 4, 4, 5, 5, 3, 2, 2, 2};
 
 
-char byte_4E8168[7][14]={  //byte_4E8178
+std::array< std::array<char, 14>, 7> byte_4E8168={{  //byte_4E8178
     { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, 
     { 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
     { 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3},
     { 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4},
     { 2, 2, 2, 2, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5},
     { 2, 2, 2, 2, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6},
-    { 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}};
+    { 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}}};
 
 int  sub_4BE571(int a1, int *a2, int a3, int a4);
 
@@ -1477,10 +1477,10 @@
   equip_type = pItemsTable->pItems[uItemID].uEquipType;
   if ( (equip_type == EQUIP_REAGENT) || (equip_type == EQUIP_POTION) || (equip_type == EQUIP_GOLD) )
   {
-    sprintf(item__getname_buffer, "%s", pItemsTable->pItems[uItemID].pName);
-    return item__getname_buffer;
+    sprintf(item__getname_buffer.data(), "%s", pItemsTable->pItems[uItemID].pName);
+    return item__getname_buffer.data();
   }
-  sprintf(item__getname_buffer, "%s", pItemsTable->pItems[uItemID].pName);
+  sprintf(item__getname_buffer.data(), "%s", pItemsTable->pItems[uItemID].pName);
   if ( uItemID == ITEM_LICH_JAR )  //Lich Jar
   {
     if ( (uHolderPlayer >0 )&& (uHolderPlayer <= 4) )
@@ -1491,21 +1491,21 @@
           format_str = pGlobalTXT_LocalizationStrings[655]; //"%s' Jar"
         else
           format_str = pGlobalTXT_LocalizationStrings[654]; //"%s's Jar"
-		sprintf(item__getname_buffer, format_str, pPlayers[uHolderPlayer]->pName);
-		return item__getname_buffer;
+		sprintf(item__getname_buffer.data(), format_str, pPlayers[uHolderPlayer]->pName);
+		return item__getname_buffer.data();
       }
   }
   if ( !pItemsTable->IsMaterialNonCommon(this) )
   {
     if ( uEnchantmentType )
     {
-      strcat(item__getname_buffer, " ");
+      strcat(item__getname_buffer.data(), " ");
       nameModificator = pItemsTable->pEnchantments[uEnchantmentType-1].pOfName;
     }
     else
     {
       if ( !uSpecEnchantmentType )
-        return item__getname_buffer;
+        return item__getname_buffer.data();
       if ( uSpecEnchantmentType == 16 //Drain Hit Points from target.
         || uSpecEnchantmentType == 39 //Double damage vs Demons.
         || uSpecEnchantmentType == 40 //Double damage vs Dragons
@@ -1521,17 +1521,17 @@
         || uSpecEnchantmentType == 67 //Adds 5 points of Body damage and +2 Disarm skill.
         || uSpecEnchantmentType == 68 ) //Adds 6-8 points of Cold damage and +5 Armor Class.
       {  //enchantment and name positions inverted!
-        sprintf( item__getname_buffer, "%s %s",
+        sprintf( item__getname_buffer.data(), "%s %s",
 				  pItemsTable->pSpecialEnchantments[uSpecEnchantmentType-1].pNameAdd,
 				  pItemsTable->pItems[uItemID].pName);
-        return item__getname_buffer;
+        return item__getname_buffer.data();
       }
-      strcat(item__getname_buffer, " ");
+      strcat(item__getname_buffer.data(), " ");
 	  nameModificator = pItemsTable->pSpecialEnchantments[uSpecEnchantmentType-1].pNameAdd;
     }
-    strcat(item__getname_buffer, nameModificator);
+    strcat(item__getname_buffer.data(), nameModificator);
   }
-  return item__getname_buffer;
+  return item__getname_buffer.data();
 }
 
 
@@ -2053,7 +2053,7 @@
     signed int v23; // [sp+24h] [bp-4h]@2
 
     v18 = rand() % 100;  //main random
-    v0 = pMapStats->GetMapInfo(pCurrentMapName);
+    v0 = pMapStats->GetMapInfo(pCurrentMapName.data());
     //	v1 = pChests;
     v2 = &pMapStats->pInfos[v0];
     //v21 = pChests;
--- a/LightmapBuilder.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/LightmapBuilder.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -671,7 +671,7 @@
   v19 = 0.0;
   thisa = this;
   v20 = 0.0;
-  result = _45CBD4(a3, a4, dword_69B010, &v22);
+  result = _45CBD4(a3, a4, dword_69B010.data(), &v22);
   for ( i = 0; i < v22; result = i )
   {
     v6 = a2;
--- a/Monsters.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Monsters.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -168,8 +168,8 @@
         return 73;
     else
         {
-        sprintf(pTmpBuf, "Unknown monster spell %s", tbl->pProperties[0]);
-        MessageBoxA(nullptr, pTmpBuf, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0);
+        sprintf(pTmpBuf.data(), "Unknown monster spell %s", tbl->pProperties[0]);
+        MessageBoxA(nullptr, pTmpBuf.data(), "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0);
         ++*next_token;
         return 0;
         }
@@ -1087,7 +1087,7 @@
                             if ( parsed_field.uPropCount  > 1 )
                                 {
                                 pTmpBuf[0] = 0;
-                                strcpy(pTmpBuf, parsed_field.pProperties[2]);
+                                strcpy(pTmpBuf.data(), parsed_field.pProperties[2]);
                                 if ( parsed_field.uPropCount  > 2 )
                                     {
                                     int prop_cnt = 3;
@@ -1095,9 +1095,9 @@
                                         {
                                         do
                                             {
-                                            strcat(pTmpBuf, " ");
+                                            strcat(pTmpBuf.data(), " ");
                                             char test_char = parsed_field.pProperties[prop_cnt][0];
-                                            strcat(pTmpBuf, parsed_field.pProperties[prop_cnt]);
+                                            strcat(pTmpBuf.data(), parsed_field.pProperties[prop_cnt]);
                                             if ( prop_cnt == (parsed_field.uPropCount - 1) )
                                                 {
                                                 switch (tolower(test_char))
@@ -1121,7 +1121,7 @@
                                     }
                                 if ( pMonsterList->uNumMonsters )
                                     {
-                                    pInfos[curr_rec_num].field_3C_some_special_attack = pMonsterList->GetMonsterIDByName(pTmpBuf) + 1;
+                                    pInfos[curr_rec_num].field_3C_some_special_attack = pMonsterList->GetMonsterIDByName(pTmpBuf.data()) + 1;
                                     if ( pInfos[curr_rec_num].field_3C_some_special_attack == -1 )
                                         {
                                         sprintf(Src, "Can't create random monster: '%s' See MapStats!", pTmpBuf);
--- a/Outdoor.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Outdoor.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -76,8 +76,8 @@
 };
 
 //for future sky textures?
-int dword_4EC268[9]={3,3,3,3,3,3,3,3,3}; // weak
-int dword_4EC28C[7]={3,3,3,3,3,3,3}; // weak
+std::array<int, 9> dword_4EC268={{3,3,3,3,3,3,3,3,3}}; // weak
+std::array<int, 7> dword_4EC28C={{3,3,3,3,3,3,3}}; // weak
 int dword_4EC2A8=9; // weak
 int dword_4EC2AC=7; // weak
 
@@ -184,7 +184,7 @@
 
   pRenderer->DrawSpriteObjects_ODM();
   pRenderer->TransformBillboardsAndSetPalettesODM();
-  sub_485F53((Vec2_int_ *)unnamed_6BE060);
+  sub_485F53((Vec2_int_ *)unnamed_6BE060.data());
 }
 
 
@@ -651,9 +651,9 @@
 //----- (00489487) --------------------------------------------------------
 void OutdoorLocation::SetFog()
 {
-  strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
+  strcpy(pOutdoor->pLevelFilename, pCurrentMapName.data());
 
-  auto map_id = pMapStats->GetMapInfo(pCurrentMapName);
+  auto map_id = pMapStats->GetMapInfo(pCurrentMapName.data());
   if (map_id == MAP_INVALID || map_id == MAP_CELESTIA || map_id == MAP_THE_PIT || map_id > MAP_SHOALS)
     return;
 
@@ -1197,9 +1197,9 @@
   v6 = pAllocator->AllocNamedChunk(0, 2u, "IDLIST");
   v1->pFaceIDLIST = (unsigned __int16 *)v6;
   *(short *)v6 = 0;
-  strcpy(v1->pSkyTextureName, pDefaultSkyTexture);
+  strcpy(v1->pSkyTextureName, pDefaultSkyTexture.data());
   v1->uSky_TextureID = pBitmaps_LOD->LoadTexture(v1->pSkyTextureName);
-  strcpy(v1->pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture);
+  strcpy(v1->pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture.data());
   v7 = pBitmaps_LOD->LoadTexture(v1->pGroundTileset);
   v8 = v1->uSky_TextureID == -1;
   v1->uMainTile_BitmapID = v7;
@@ -1816,10 +1816,10 @@
   pGameLoadingUI_ProgressBar->Progress();
   memcpy(&uNumTerrainNormals, pSrc, 4);
   //v43 = (char *)v43 + 4;
-  memcpy(pTerrainSomeOtherData, pSrc + 4, 0x20000);
+  memcpy(pTerrainSomeOtherData.data(), pSrc + 4, 0x20000);
   pSrc += 4 + 0x20000;
   //v43 = (char *)v43 + 131072;
-  memcpy(pTerrainNormalIndices, pSrc, 0x10000);
+  memcpy(pTerrainNormalIndices.data(), pSrc, 0x10000);
   pSrc += 0x10000;
   //v43 = (char *)v43 + 65536;
 
@@ -2345,7 +2345,7 @@
   pTileTable->InitializeTileset(pTileTypes[2].tileset);
   //v108 = pTileTypes[3].uTileGroup;
   pTileTable->InitializeTileset(pTileTypes[3].tileset);
-  strcpy(pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture);
+  strcpy(pGroundTileset, byte_6BE124_cfg_textures_DefaultGroundTexture.data());
   //v97 = pTileTypes[0].uTileID;
   //v108 = 0;
   auto v98 = pTileTable->GetTileById(pTileTypes[0].uTileID);
@@ -2703,7 +2703,7 @@
 
   v1 = 0;
   v8 = 0;
-  if ( !_stricmp(pCurrentMapName, "out09.odm") )
+  if ( !_stricmp(pCurrentMapName.data(), "out09.odm") )
     v8 = 1;
 
   for (uint i = 0; i < uNumLevelDecorations; ++i)
--- a/Party.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Party.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -196,7 +196,7 @@
 	  byte_AE3368[v4] = 1;
   }
   if ( (unsigned __int8)(byte_AE3369 & byte_AE336A & byte_AE336B) & byte_AE3368[0] )
-    memset(byte_AE3368, 0, 4u);
+    memset(byte_AE3368.data(), 0, 4u);
   v2 = v12;
   if ( v12 )
     return v2 + 1;
--- a/Player.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Player.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -1431,8 +1431,8 @@
   }
   else
   {
-    sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[67], this->pName);
-    ShowStatusBarString(pTmpBuf, 2u);
+    sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[67], this->pName);
+    ShowStatusBarString(pTmpBuf.data(), 2u);
     result = 0;
   }
   return result;
@@ -3444,8 +3444,8 @@
           {
             party_finds_gold(v19, 2);
             v22 = v19;
-            v23 = pTmpBuf2;
-            sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[302], v31->pName, v22);
+            v23 = pTmpBuf2.data();
+            sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[302], v31->pName, v22);
 LABEL_43:
             ShowStatusBarString(v23, 2u);
             return _steal_perma;
@@ -3493,11 +3493,11 @@
             }
             sub_421B2C_PlaceInInventory_or_DropPickedItem();
             sprintf(
-              pTmpBuf2,
+              pTmpBuf2.data(),
               pGlobalTXT_LocalizationStrings[304],
               v31->pName,
               pItemsTable->pItems[v16].pUnidentifiedName);
-            ShowStatusBarString(pTmpBuf2, 2u);
+            ShowStatusBarString(pTmpBuf2.data(), 2u);
             sub_421B2C_PlaceInInventory_or_DropPickedItem();
             memcpy(&pParty->pPickedItem, &v27, sizeof(pParty->pPickedItem));
             pMouse->SetCursorBitmapFromItemID(v16);
@@ -3508,8 +3508,8 @@
       v26 = (int)v31->pName;
       v25 = pGlobalTXT_LocalizationStrings[377];
     }
-    v23 = pTmpBuf2;
-    sprintfex(pTmpBuf2, v25, v26);
+    v23 = pTmpBuf2.data();
+    sprintfex(pTmpBuf2.data(), v25, v26);
     goto LABEL_43;
   }
   return 0;
@@ -6747,8 +6747,8 @@
         else
             {    
             v68 = pParty->pPickedItem.GetDisplayName();
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way"
-            ShowStatusBarString(pTmpBuf, 2);
+            sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way"
+            ShowStatusBarString(pTmpBuf.data(), 2);
             pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
             return;
             }
@@ -7039,8 +7039,8 @@
 
         default:
             v68 = pParty->pPickedItem.GetDisplayName();
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way"
-            ShowStatusBarString(pTmpBuf, 2u);
+            sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way"
+            ShowStatusBarString(pTmpBuf.data(), 2u);
             pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
             return;
             }
@@ -7083,8 +7083,8 @@
             {
 
             v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
-        sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[382], v68);
-        ShowStatusBarString(pTmpBuf, 2u);
+        sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68);
+        ShowStatusBarString(pTmpBuf.data(), 2u);
         pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
         return;
             }
@@ -7127,16 +7127,16 @@
         if ( v72 )
             {
             v66 = pParty->pPickedItem.GetDisplayName();
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[380], v66);//"You already know the %s spell"
-            ShowStatusBarString(pTmpBuf, 2u);
+            sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[380], v66);//"You already know the %s spell"
+            ShowStatusBarString(pTmpBuf.data(), 2u);
             pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
             return;
             }
         if ( !pParty->pPlayers[player_num-1].CanAct() )
             {
             v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[382], v66);//"That player is %s"
-            ShowStatusBarString(pTmpBuf, 2u);
+            sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v66);//"That player is %s"
+            ShowStatusBarString(pTmpBuf.data(), 2u);
             pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
             return;
             }
@@ -7156,8 +7156,8 @@
         if ( v16 > v67 || !v17 )
             {
             v22 = pParty->pPickedItem.GetDisplayName();
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22); //"You don't have the skill to learn %s"
-            ShowStatusBarString(pTmpBuf, 2u);
+            sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[381], v22); //"You don't have the skill to learn %s"
+            ShowStatusBarString(pTmpBuf.data(), 2u);
             v3->PlaySound((PlayerSpeech)20, 0);
             return; 
             }
@@ -7203,8 +7203,8 @@
             return;
             }
         v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
-        sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[382], v68);
-        ShowStatusBarString(pTmpBuf, 2u);
+        sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68);
+        ShowStatusBarString(pTmpBuf.data(), 2u);
         pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
         return;
         }
@@ -7221,47 +7221,47 @@
                 {
             case 0:
                 v3->uMight += thisa;
-                sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
+                sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
                 break;
             case 1:
                 v3->uIntelligence += thisa;
-                sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
+                sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
                 break;
             case 2:
                 v3->uWillpower += thisa;
-                sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
+                sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
                 break;
             case 3:
                 v3->uEndurance += thisa;
-                sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
+                sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
                 break;
             case 4:
                 v3->uAccuracy += thisa;
-               sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
+               sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
                 break;
             case 5:
                 v3->uSpeed += thisa;
-                sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
+                sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
                 break;
             case 6:
                 v3->uLuck += thisa;
-               sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
+               sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"	
                 break;
             case 7:
                 party_finds_gold(1000 * thisa, 0);
-                sprintf(pTmpBuf, "+%u %s", 1000 * thisa, pGlobalTXT_LocalizationStrings[97]);//"Gold"
+                sprintf(pTmpBuf.data(), "+%u %s", 1000 * thisa, pGlobalTXT_LocalizationStrings[97]);//"Gold"
                 break;
             case 8:
                 Party::GiveFood(5 * thisa); 
-                sprintf(pTmpBuf, "+%u %s",5 * thisa , pGlobalTXT_LocalizationStrings[653]);//"Food"
+                sprintf(pTmpBuf.data(), "+%u %s",5 * thisa , pGlobalTXT_LocalizationStrings[653]);//"Food"
                 break;
             case 9u:
                 v3->uSkillPoints += 2 * thisa;
-                sprintf(pTmpBuf, "+%u %s", 2 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]);
+                sprintf(pTmpBuf.data(), "+%u %s", 2 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]);
                 break;
             case 10:
                 v3->uExperience += 2500 * thisa;
-                sprintf(pTmpBuf, "+%u %s", 2500 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]);
+                sprintf(pTmpBuf.data(), "+%u %s", 2500 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]);
                 break;
             case 11:
                 v8 = rand() % 6;
@@ -7292,11 +7292,11 @@
                     v13 = pGlobalTXT_LocalizationStrings[29];
                     break;
                     }
-                sprintf(pTmpBuf, "+%u %s %s", thisa, v13, pGlobalTXT_LocalizationStrings[121]);
+                sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v13, pGlobalTXT_LocalizationStrings[121]);
                 break;
 
                 }
-            ShowStatusBarString(pTmpBuf, 2u);
+            ShowStatusBarString(pTmpBuf.data(), 2u);
             pMouse->RemoveHoldingItem();
             pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1);
             v3->PlaySound(SPEECH_93, 0);
@@ -7355,8 +7355,8 @@
                 {
    
                 v68 = pParty->pPickedItem.GetDisplayName();
-                sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[36],v68);//"%s can not be used that way"
-                ShowStatusBarString(pTmpBuf, 2u);
+                sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36],v68);//"%s can not be used that way"
+                ShowStatusBarString(pTmpBuf.data(), 2u);
                 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
                 return;
                 }
@@ -8047,15 +8047,15 @@
         case VAR_RandomGold:
           v6 = rand() % var_value + 1;
           Party::SetGold(v6);
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[500], v6);// You have %lu gold
-          ShowStatusBarString(pTmpBuf, 2u);
+          sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[500], v6);// You have %lu gold
+          ShowStatusBarString(pTmpBuf.data(), 2u);
           GameUI_DrawFoodAndGold();
           return;
         case VAR_RandomFood:
           v7 = rand() % var_value + 1;
           Party::SetFood(v7);
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food
-          ShowStatusBarString(pTmpBuf, 2u);
+          sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food
+          ShowStatusBarString(pTmpBuf.data(), 2u);
           GameUI_DrawFoodAndGold();
           goto LABEL_124;
         case VAR_Sex:
@@ -8481,8 +8481,8 @@
                 val = 1;
               v7 = rand() % val + 1;
               Party::GiveFood(v7);
-              sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[502], v7);// You find %lu food
-              ShowStatusBarString(pTmpBuf, 2u);
+              sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], v7);// You find %lu food
+              ShowStatusBarString(pTmpBuf.data(), 2u);
               GameUI_DrawFoodAndGold();
               goto _play_sound;
             case VAR_Sex:
@@ -8611,8 +8611,8 @@
               goto LABEL_82;
             case VAR_FixedFood:
               Party::GiveFood(val);
-              sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[502], val);
-              ShowStatusBarString(pTmpBuf, 2u);
+              sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], val);
+              ShowStatusBarString(pTmpBuf.data(), 2u);
               if ( pParty->uNumFoodRations > 0xFFFF )
                 Party::SetFood(0xFFFFu);
               goto _play_sound;
@@ -9121,8 +9121,8 @@
           if ( v6 > pParty->uNumGold )
             v6 = pParty->uNumGold;
           Party::TakeGold(v6);
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[503], v6);
-          ShowStatusBarString(pTmpBuf, 2);
+          sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[503], v6);
+          ShowStatusBarString(pTmpBuf.data(), 2);
           GameUI_DrawFoodAndGold();
           return result;
         case VAR_RandomFood:
@@ -9130,8 +9130,8 @@
           if ( v7 > pParty->uNumFoodRations )
             v7 = pParty->uNumFoodRations;
           Party::TakeFood(v7);
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[504], v7);
-          ShowStatusBarString(pTmpBuf, 2u);
+          sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[504], v7);
+          ShowStatusBarString(pTmpBuf.data(), 2u);
           GameUI_DrawFoodAndGold();
           pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
           v8 = 8 * v4 + 400;
--- a/Render.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Render.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -1134,7 +1134,7 @@
       if ( v120 > terrain_76DFC8[v17] )
       {
         v125 = v120;
-        memset32(terrain_76D9C8, v119 + 1, 4 * (v120 - terrain_76DFC8[v17] + 1));
+        memset32(terrain_76D9C8.data(), v119 + 1, 4 * (v120 - terrain_76DFC8[v17] + 1));
         v19 = v120;
         do
           terrain_76DBC8[v126++] = v19--;
@@ -1182,7 +1182,7 @@
       if ( v120 > terrain_76E3C8[v18] )
       {
         v125 = v120;
-        memset32(terrain_76D5C8, v122, 4 * (v120 - terrain_76E3C8[v18] + 1));
+        memset32(terrain_76D5C8.data(), v122, 4 * (v120 - terrain_76E3C8[v18] + 1));
         do
         {
           v25 = v126;
@@ -1235,7 +1235,7 @@
       if ( v122 < terrain_76DDC8[v17] )
       {
         v106 = v122;
-        memset32(terrain_76DBC8, v120 + 1, 4 * (terrain_76DDC8[v17] - v122 + 1));
+        memset32(terrain_76DBC8.data(), v120 + 1, 4 * (terrain_76DDC8[v17] - v122 + 1));
         for ( v32 = v122; v32 <= terrain_76DDC8[v17]; v32++)
           terrain_76D9C8[v126++] = v32;
         if ( terrain_76DDC8[v17] == terrain_76DBC8[v17 -1] )
@@ -1280,7 +1280,7 @@
       if ( v122 < v37 )
       {
         v114 = v122;
-        memset32(terrain_76D7C8, i, 4 * (v37 - v122 + 1));
+        memset32(terrain_76D7C8.data(), i, 4 * (v37 - v122 + 1));
         do
         {
           v38 = v126;
@@ -1332,7 +1332,7 @@
       if ( v119 > terrain_76DDC8[v17] )
       {
         v106 = v119;
-        memset32(terrain_76DBC8, i, 4 * (v119 - terrain_76DDC8[v17] + 1));
+        memset32(terrain_76DBC8.data(), i, 4 * (v119 - terrain_76DDC8[v17] + 1));
         for ( v45 = v119; v45 >= terrain_76DDC8[v17]; v45--)
           terrain_76D9C8[v126++] = v45;
         if ( terrain_76DDC8[v17] == terrain_76DBC8[v17 -1] )
@@ -1377,7 +1377,7 @@
       if ( v119 > v49 )
       {
         v125 = v119;
-        memset32(terrain_76D7C8, v120 + 1, 4 * (v119 - v49 + 1));
+        memset32(terrain_76D7C8.data(), v120 + 1, 4 * (v119 - v49 + 1));
         do
         {
           v50 = v126;
@@ -1429,7 +1429,7 @@
       if ( i < terrain_76DFC8[v17] )
       {
         v106 = i;
-        memset32(terrain_76D9C8, v122, 4 * (terrain_76DFC8[v17] - i + 1));
+        memset32(terrain_76D9C8.data(), v122, 4 * (terrain_76DFC8[v17] - i + 1));
         v56 = i;
         do
         {
@@ -1480,7 +1480,7 @@
       if ( i < v62 )
       {
         v114 = i;
-        memset32(terrain_76D5C8, v119 + 1, 4 * (v62 - i + 1));
+        memset32(terrain_76D5C8.data(), v119 + 1, 4 * (v62 - i + 1));
         do
         {
           v63 = v126;
@@ -2831,7 +2831,7 @@
           v17->field_34 = v58->distance;
           v17->terrain_grid_z = v94;
           v17->terrain_grid_x = LOBYTE(v99);
-          v59 = *(unsigned __int16 *)((char *)pTerrainNormalIndices + LODWORD(v93));
+          v59 = *(unsigned __int16 *)((char *)pTerrainNormalIndices.data() + LODWORD(v93));
           if ( v59 > (signed int)(uNumTerrainNormals - 1) )
           {
             pNormalb = 0;
@@ -8975,7 +8975,7 @@
     LODWORD(v40) = (int)v14;
 
     int __i = 0;
-    v15 = dword_F1B430;
+    v15 = dword_F1B430.data();
     do
     {
       v16 = v3;
--- a/SaveLoad.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/SaveLoad.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -66,8 +66,8 @@
   for (uint i = 1; i < 5; ++i)
     for (uint j = 1; j < 6; ++j)
     {
-      sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", i, j);
-      remove(pTmpBuf);
+      sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j);
+      remove(pTmpBuf.data());
     }
 
 
@@ -89,10 +89,10 @@
         }
     }
 
-  sprintf(pTmpBuf, "saves\\%s", pSavegameList->pFileList[uSlot].pSaveFileName);
+  sprintf(pTmpBuf.data(), "saves\\%s", pSavegameList->pFileList[uSlot].pSaveFileName);
 
   pNew_LOD->CloseWriteFile();
-  if (!CopyFileA(pTmpBuf, "data\\new.lod", 0))
+  if (!CopyFileA(pTmpBuf.data(), "data\\new.lod", 0))
     int e = GetLastError();
 
   pNew_LOD->LoadFile("data\\new.lod", 0);
@@ -206,15 +206,15 @@
   pEventTimer->StopGameTime();
 
   v25 = pGames_LOD->DoesContainerExist(header.pLocationName);
-  sprintf(pTmpBuf, "levels\\%s", header.pLocationName);
-  v26 = _access(pTmpBuf, 4) != -1;
+  sprintf(pTmpBuf.data(), "levels\\%s", header.pLocationName);
+  v26 = _access(pTmpBuf.data(), 4) != -1;
   if ( !v25 && !v26 )
   {
-    sprintf(pTmpBuf, "Unable to find: %s!", header.pLocationName);
-    Abortf(pTmpBuf);
+    sprintf(pTmpBuf.data(), "Unable to find: %s!", header.pLocationName);
+    Abortf(pTmpBuf.data());
   }
 
-  strcpy(pCurrentMapName, header.pLocationName);
+  strcpy(pCurrentMapName.data(), header.pLocationName);
   dword_6BE364_game_settings_1 |= 0x2001;
 
   for (uint i = 0; i < uNumSavegameFiles; ++i)
@@ -259,8 +259,8 @@
   unsigned int compressed_block_size; // [sp+260h] [bp-10h]@23
  
   //v66 = a2;
-  strcpy(byte_6BE3B0, pCurrentMapName);
-  if (!_stricmp(pCurrentMapName, "d05.blv")) // arena
+  strcpy(byte_6BE3B0.data(), pCurrentMapName.data());
+  if (!_stricmp(pCurrentMapName.data(), "d05.blv")) // arena
     return;
 
   uncompressed_buff = (char*)malloc(1000000);
@@ -310,7 +310,7 @@
   memset(save_header.pName, 0, 20);
   memset(save_header.pLocationName, 0, 20);
   memset(save_header.field_30, 0, 52);
-  strcpy(save_header.pLocationName, pCurrentMapName);
+  strcpy(save_header.pLocationName, pCurrentMapName.data());
   save_header.uWordTime = pParty->uTimePlayed;
   strcpy(pLodDirectory.pFilename, "header.bin");
   pLodDirectory.uDataSize = sizeof(SavegameHeader);
@@ -483,7 +483,7 @@
       memcpy(data_write_pos, &pOutdoor->loc_time, 0x38);
       data_write_pos += 56;
     }
-    strcpy(Source, pCurrentMapName);
+    strcpy(Source, pCurrentMapName.data());
     _splitpath(Source, Drive, Dir, Filename, Ext);
    
     Size = (int)data_write_pos - (int)uncompressed_buff;
@@ -539,20 +539,20 @@
 
   //v1 = uSlot;
   //v6 = uSlot;
-  bNotArena = _stricmp(pCurrentMapName, "d05.blv");
+  bNotArena = _stricmp(pCurrentMapName.data(), "d05.blv");
   if ( bNotArena )
   {
     LOD::Directory pDir; // [sp+Ch] [bp-28h]@2
     SaveGame(0, 0);
     //v2 = 100 * v1;
-    strcpy(pSavegameHeader[uSlot].pLocationName, pCurrentMapName);
+    strcpy(pSavegameHeader[uSlot].pLocationName, pCurrentMapName.data());
     pSavegameHeader[uSlot].uWordTime = pParty->uTimePlayed;
     strcpy(pDir.pFilename, "header.bin");
     pDir.uDataSize = 100;
     pNew_LOD->Write(&pDir, &pSavegameHeader[uSlot], 0);
-    sprintf(pTmpBuf, "saves\\save%03d.mm7", uSlot);
+    sprintf(pTmpBuf.data(), "saves\\save%03d.mm7", uSlot);
     pNew_LOD->CloseWriteFile();
-    CopyFileA("data\\new.lod", pTmpBuf, 0);
+    CopyFileA("data\\new.lod", pTmpBuf.data(), 0);
   }
   GUI_UpdateWindows();
   pGUIWindow_CurrentMenu->Release();
@@ -597,14 +597,14 @@
 
     for (uint i = 0; i < 40; ++i)
     {
-      sprintf(pTmpBuf, "save%03d.mm7", i);
-      if (_access(pTmpBuf, 0) == -1)
+      sprintf(pTmpBuf.data(), "save%03d.mm7", i);
+      if (_access(pTmpBuf.data(), 0) == -1)
         continue;
 
       uint idx = i;
       if (!bHideEmptySlots)
         idx = uNumSavegameFiles;
-      strcpy(pSavegameList->pFileList[idx].pSaveFileName, pTmpBuf);
+      strcpy(pSavegameList->pFileList[idx].pSaveFileName, pTmpBuf.data());
 
       ++uNumSavegameFiles;
     }
--- a/Spells.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Spells.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -173,8 +173,8 @@
 };
 
 
-	unsigned char pSpellbookSpellIndices[9][12] = // 4E2430
-	{  //0   1   2   3  4    5   6  7    8  9   10  11
+std::array<std::array<unsigned char, 12>, 9> pSpellbookSpellIndices = // 4E2430
+	{{  //0   1   2   3  4    5   6  7    8  9   10  11
 		{0,  3,  1,  8, 11,  7,  4, 10,  6,  2,  5,  9},
 		{0, 11,  2,  9,  6,  8,  5, 10,  3,  7,  1,  4},
 		{0,  4,  8,  9,  1, 10,  3, 11,  7,  6,  2,  5}, 
@@ -184,7 +184,7 @@
 		{0,  1,  6,  9,  3,  5,  8, 11,  7, 10,  4,  2},
 		{0,  1, 10, 11,  9,  4,  3,  6,  5,  7,  8,  2},
 		{0,  9,  3,  7,  1,  5,  2, 10, 11,  8,  6,  4}
-	};
+}};
 
 	struct SpellBookIconPos pIconPos[9][12]={
 
--- a/SpriteObject.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/SpriteObject.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -1017,7 +1017,7 @@
   int v18; // [sp+14h] [bp-4h]@14
 
   v1 = this;
-  pMapInfo = &pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)];
+  pMapInfo = &pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName.data())];
   v3 = abs(pParty->vPosition.x - v1->vPosition.x);
   v15 = abs(pParty->vPosition.y - v1->vPosition.y);
   v16 = abs(pParty->vPosition.z + pParty->sEyelevel - v1->vPosition.z);
--- a/Texture.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Texture.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -442,8 +442,8 @@
   File = v3;
   if ( !v3 )
   {
-    sprintf(pTmpBuf, "Unable to load %s", pContainer);
-    Abortf(pTmpBuf);
+    sprintf(pTmpBuf.data(), "Unable to load %s", pContainer);
+    Abortf(pTmpBuf.data());
   }
   fread(&DstBuf, 1u, 0x30u, v3);
   Count = DstBuf.uTextureSize;
@@ -532,8 +532,8 @@
   File = v4;
   if ( !v4 )
   {
-    sprintf(pTmpBuf, "Unable to load %s", pContainer);
-    Abortf(pTmpBuf);
+    sprintf(pTmpBuf.data(), "Unable to load %s", pContainer);
+    Abortf(pTmpBuf.data());
   }
   fread(&DstBuf, 1u, 0x30u, v4);
   Count = DstBuf.uTextureSize;
--- a/UIBooks.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UIBooks.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -264,39 +264,39 @@
 		v2=1;
   }
 
-  sprintf(pTmpBuf, "%s\t100:\t110%d:%02d %s - %s",
+  sprintf(pTmpBuf.data(), "%s\t100:\t110%d:%02d %s - %s",
           pGlobalTXT_LocalizationStrings[526], // "Time"
           v0,
           pParty->uCurrentMinute,
           aAMPMNames[v2],
           GetDayPart());
-  a1.DrawText(pBookFont, 70, 55, ui_book_calendar_time_color, pTmpBuf, 0, 0, 0);
+  a1.DrawText(pBookFont, 70, 55, ui_book_calendar_time_color, pTmpBuf.data(), 0, 0, 0);
 
-  sprintf(pTmpBuf, "%s\t100:\t110%d - %s",
+  sprintf(pTmpBuf.data(), "%s\t100:\t110%d - %s",
           pGlobalTXT_LocalizationStrings[56], // "Day"
           pParty->uDaysPlayed + 1,
           aDayNames[pParty->uDaysPlayed % 7]);
-  a1.DrawText(pBookFont, 70, 2 * LOBYTE(pBookFont->uFontHeight) + 49, ui_book_calendar_day_color, pTmpBuf, 0, 0, 0);
+  a1.DrawText(pBookFont, 70, 2 * LOBYTE(pBookFont->uFontHeight) + 49, ui_book_calendar_day_color, pTmpBuf.data(), 0, 0, 0);
 
-  sprintf(pTmpBuf, "%s\t100:\t110%d - %s",
+  sprintf(pTmpBuf.data(), "%s\t100:\t110%d - %s",
           pGlobalTXT_LocalizationStrings[146], // "Month"
           pParty->uCurrentMonth + 1,
           aMonthNames[pParty->uCurrentMonth]);
-  a1.DrawText(pBookFont, 70, 4 * LOBYTE(pBookFont->uFontHeight) + 43, ui_book_calendar_month_color, pTmpBuf, 0, 0, 0);
+  a1.DrawText(pBookFont, 70, 4 * LOBYTE(pBookFont->uFontHeight) + 43, ui_book_calendar_month_color, pTmpBuf.data(), 0, 0, 0);
 
-  sprintf(pTmpBuf, "%s\t100:\t110%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); // "Year"
-  a1.DrawText(pBookFont, 70, 6 * LOBYTE(pBookFont->uFontHeight) + 37, ui_book_calendar_year_color, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), "%s\t100:\t110%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); // "Year"
+  a1.DrawText(pBookFont, 70, 6 * LOBYTE(pBookFont->uFontHeight) + 37, ui_book_calendar_year_color, pTmpBuf.data(), 0, 0, 0);
 
-  sprintf(pTmpBuf, "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[530], aMoonPhaseNames[pDayMoonPhase[pParty->uDaysPlayed]]); // "Moon"
-  a1.DrawText(pBookFont, 70, 8 * LOBYTE(pBookFont->uFontHeight) + 31, ui_book_calendar_moon_color, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[530], aMoonPhaseNames[pDayMoonPhase[pParty->uDaysPlayed]]); // "Moon"
+  a1.DrawText(pBookFont, 70, 8 * LOBYTE(pBookFont->uFontHeight) + 31, ui_book_calendar_moon_color, pTmpBuf.data(), 0, 0, 0);
   
-  v6 = pMapStats->GetMapInfo(pCurrentMapName);
+  v6 = pMapStats->GetMapInfo(pCurrentMapName.data());
   if ( v6 )
     v3 = pMapStats->pInfos[v6].pName;
   else
     v3 = "Unknown";
-  sprintf(pTmpBuf, "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[531], v3); // "Location"
-  a1.DrawText(pBookFont, 70, 10 * LOBYTE(pBookFont->uFontHeight) + 25, ui_book_calendar_location_color, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[531], v3); // "Location"
+  a1.DrawText(pBookFont, 70, 10 * LOBYTE(pBookFont->uFontHeight) + 25, ui_book_calendar_location_color, pTmpBuf.data(), 0, 0, 0);
 }
 
 
@@ -332,10 +332,10 @@
   {
     pSpellBookPagesTextr[i] = pIcons_LOD->LoadTexturePtr(texNames[i], TEXTURE_16BIT_PALETTE);
 
-    sprintf(pTmpBuf, "tab%da", i+1);
-    pTextures_tabs[i][0] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
-    sprintf(pTmpBuf, "tab%db", i+1);
-    pTextures_tabs[i][1] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
+    sprintf(pTmpBuf.data(), "tab%da", i+1);
+    pTextures_tabs[i][0] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
+    sprintf(pTmpBuf.data(), "tab%db", i+1);
+    pTextures_tabs[i][1] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
   }
 }
 
@@ -1103,7 +1103,7 @@
   map_window.uFrameY = game_viewport_y;
   map_window.uFrameZ = game_viewport_z;
   map_window.uFrameW = game_viewport_w;
-  map_id = pMapStats->GetMapInfo(pCurrentMapName);
+  map_id = pMapStats->GetMapInfo(pCurrentMapName.data());
   if ( map_id )
     map_window.DrawTitleText(pBook2Font, -14, 12, ui_book_map_title_color, pMapStats->pInfos[map_id].pName, 3);
 
--- a/UICharacter.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UICharacter.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -77,7 +77,7 @@
 unsigned int ui_book_journal_text_color;
 unsigned int ui_book_journal_text_shadow;
 
-unsigned int papredoll_dbrds[16];
+std::array<unsigned int, 16> papredoll_dbrds;
 unsigned int papredoll_drhs[4];
 unsigned int papredoll_dlhus[4];
 unsigned int papredoll_dlhs[4];
@@ -449,8 +449,8 @@
 {
   int y_offset = y;
   
-  sprintf(pTmpBuf, "%s\r%03d%s", skill_group_name, right_margin, pGlobalTXT_LocalizationStrings[131]); //"Level"
-  pGUIWindow_CurrentMenu->DrawText(pFontArrus, x, y, ui_character_header_text_color, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), "%s\r%03d%s", skill_group_name, right_margin, pGlobalTXT_LocalizationStrings[131]); //"Level"
+  pGUIWindow_CurrentMenu->DrawText(pFontArrus, x, y, ui_character_header_text_color, pTmpBuf.data(), 0, 0, 0);
 
   int num_skills_drawn = 0;
   for (uint i = 0; i < skill_list_size; ++i)
@@ -491,8 +491,8 @@
 
       if (SkillToMastery(skill_value) == 1)
       {
-        sprintfex(pTmpBuf, "%s\r%03d%2d", pSkillNames[skill], right_margin, skill_level);
-        pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, v8->uY, skill_color, pTmpBuf, 0, 0, 0);
+        sprintfex(pTmpBuf.data(), "%s\r%03d%2d", pSkillNames[skill], right_margin, skill_level);
+        pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, v8->uY, skill_color, pTmpBuf.data(), 0, 0, 0);
       }
       else
       {
@@ -508,8 +508,8 @@
         if (!skill_mastery_color)
           skill_mastery_color = ui_character_header_text_color;
 
-        sprintfex(pTmpBuf, "%s \f%05d%s\f%05d\r%03d%2d", pSkillNames[skill], skill_mastery_color, skill_level_str, skill_color, right_margin, skill_level);
-        pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, v8->uY, skill_color, pTmpBuf, 0, 0, 0);
+        sprintfex(pTmpBuf.data(), "%s \f%05d%s\f%05d\r%03d%2d", pSkillNames[skill], skill_mastery_color, skill_level_str, skill_color, right_margin, skill_level);
+        pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, v8->uY, skill_color, pTmpBuf.data(), 0, 0, 0);
       }
     }
   }
@@ -530,14 +530,14 @@
 {
   pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_skill", TEXTURE_16BIT_PALETTE));
 
-  sprintfex(pTmpBuf, "%s \f%05d^Pv[%s]\f00000\r177%s: \f%05d%d\f00000",
+  sprintfex(pTmpBuf.data(), "%s \f%05d^Pv[%s]\f00000\r177%s: \f%05d%d\f00000",
             pGlobalTXT_LocalizationStrings[206],        // Skills for
             ui_character_header_text_color,
             player->pName,
             pGlobalTXT_LocalizationStrings[207],        // Skill Points
             player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color,
             player->uSkillPoints);
-  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0);
 
   int y = 2 * LOBYTE(pFontLucida->uFontHeight) + 13;
   y = CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 24, y, pWeaponSkills, 9, 400, pGlobalTXT_LocalizationStrings[242]); // "Weapons"
@@ -588,12 +588,12 @@
     //int v22; // [sp+CCh] [bp-4h]@40
 
   pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_award", TEXTURE_16BIT_PALETTE));
-  sprintfex(pTmpBuf, "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], ui_character_header_text_color);
+  sprintfex(pTmpBuf.data(), "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], ui_character_header_text_color);
   sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]);
-  strcat(pTmpBuf, Source);
-  strcat(pTmpBuf, "\f00000");
+  strcat(pTmpBuf.data(), Source);
+  strcat(pTmpBuf.data(), "\f00000");
 
-  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0);
   result = dword_506528;
   a1.uFrameX = 12;
   a1.uFrameY = 48;
@@ -644,20 +644,20 @@
             pTmpBuf[0] = 0;
             switch (v5)
             {
-              case Award_Arena_PageWins:    sprintf(pTmpBuf, v6, pParty->uNumArenaPageWins);     break;
-              case Award_Arena_SquireWins:  sprintf(pTmpBuf, v6, pParty->uNumArenaSquireWins);   break;
-              case Award_Arena_KnightWins:  sprintf(pTmpBuf, v6, pParty->uNumArenaKnightWins);   break;
-              case Award_Arena_LordWins:    sprintf(pTmpBuf, v6, pParty->uNumArenaLordWins);     break;
-              case Award_ArcomageWins:      sprintf(pTmpBuf, v6, pParty->uNumArcomageWins);      break;
-              case Award_ArcomageLoses:     sprintf(pTmpBuf, v6, pParty->uNumArcomageLoses);     break;
-              case Award_Deaths:            sprintf(pTmpBuf, v6, pParty->uNumDeaths);            break;
-              case Award_BountiesCollected: sprintf(pTmpBuf, v6, pParty->uNumBountiesCollected); break;
-              case Award_Fine:              sprintf(pTmpBuf, v6, pParty->uFine);                 break;
-              case Award_PrisonTerms:       sprintf(pTmpBuf, v6, pParty->uNumPrisonTerms);       break;
+              case Award_Arena_PageWins:    sprintf(pTmpBuf.data(), v6, pParty->uNumArenaPageWins);     break;
+              case Award_Arena_SquireWins:  sprintf(pTmpBuf.data(), v6, pParty->uNumArenaSquireWins);   break;
+              case Award_Arena_KnightWins:  sprintf(pTmpBuf.data(), v6, pParty->uNumArenaKnightWins);   break;
+              case Award_Arena_LordWins:    sprintf(pTmpBuf.data(), v6, pParty->uNumArenaLordWins);     break;
+              case Award_ArcomageWins:      sprintf(pTmpBuf.data(), v6, pParty->uNumArcomageWins);      break;
+              case Award_ArcomageLoses:     sprintf(pTmpBuf.data(), v6, pParty->uNumArcomageLoses);     break;
+              case Award_Deaths:            sprintf(pTmpBuf.data(), v6, pParty->uNumDeaths);            break;
+              case Award_BountiesCollected: sprintf(pTmpBuf.data(), v6, pParty->uNumBountiesCollected); break;
+              case Award_Fine:              sprintf(pTmpBuf.data(), v6, pParty->uFine);                 break;
+              case Award_PrisonTerms:       sprintf(pTmpBuf.data(), v6, pParty->uNumPrisonTerms);       break;
             }
 
-            if (*pTmpBuf)
-              v6 = pTmpBuf;
+            if (*pTmpBuf.data())
+              v6 = pTmpBuf.data();
 
 
             a1.DrawText(pFontArrus, 0, 0, ui_character_award_color[pAwards[v5].uPriority % 6], v6, 0, 0, 0);
@@ -1979,7 +1979,7 @@
       }
     }
   }
-  memset(byte_5111F6, 0, 16);
+  memset(byte_5111F6.data(), 0, 16);
   for (uint i = 0; i < 4; ++i)
   {
     auto player = pParty->pPlayers + i;
@@ -2293,64 +2293,64 @@
         //pPlayer = &pParty->pPlayers[uPlayerID-1];
         //pPlayer = player;
   pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_stats", TEXTURE_16BIT_PALETTE));
-  sprintf(pTmpBuf, "\f%05d", ui_character_header_text_color);
-  sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]);//"^Pi[%s] %s" / "%s the %s"
-  strcat(pTmpBuf, pTmpBuf2);
-  sprintfex(pTmpBuf2,  "\f00000\r180%s: \f%05d%d\f00000\n\n\n",
+  sprintf(pTmpBuf.data(), "\f%05d", ui_character_header_text_color);
+  sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]);//"^Pi[%s] %s" / "%s the %s"
+  strcat(pTmpBuf.data(), pTmpBuf2.data());
+  sprintfex(pTmpBuf2.data(),  "\f00000\r180%s: \f%05d%d\f00000\n\n\n",
             pGlobalTXT_LocalizationStrings[207], // "Skill points"
             player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color,
             player->uSkillPoints);
-  strcat(pTmpBuf, pTmpBuf2);
-  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf, 0, 0, 0);
+  strcat(pTmpBuf.data(), pTmpBuf2.data());
+  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf.data(), 0, 0, 0);
 
   v10 = 53;
   v7 = player->GetBaseStrength();
   v8 = player->GetActualMight();
   v9 = UI_GetHealthManaStringColor(v8, v7);
-  sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], v9, v8, v7);//Might
-  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], v9, v8, v7);//Might
+  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
   v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
   v13 = player->GetBaseIntelligence();
   v14 = player->GetActualIntelligence();
   v15 = UI_GetHealthManaStringColor(v14, v13);
-  sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], v15, v14, v13);//Intellect
-  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], v15, v14, v13);//Intellect
+  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
   v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
   v19 = player->GetBaseWillpower();
   v20 = player->GetActualWillpower();
   v21 = UI_GetHealthManaStringColor(v20, v19);
-  sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], v21, v20, v19);//
-  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], v21, v20, v19);//
+  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
   v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
   v25 = player->GetBaseEndurance();
   v26 = player->GetActualEndurance();
   v27 = UI_GetHealthManaStringColor(v26, v25);
-  sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], v27, v26, v25);//
-  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], v27, v26, v25);//
+  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
   v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
   v31 = player->GetBaseAccuracy();
   v32 = player->GetActualAccuracy();
   v33 = UI_GetHealthManaStringColor(v32, v31);
-  sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], v33, v32, v31);
-  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], v33, v32, v31);
+  pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
         v37 = player->GetBaseSpeed();
         v38 = player->GetActualSpeed();
         v39 = UI_GetHealthManaStringColor(v38, v37);
-        sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], v39, v38, v37);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], v39, v38, v37);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
         v43 = player->GetBaseLuck();
         v44 = player->GetActualLuck();
         v45 = UI_GetHealthManaStringColor(v44, v43);
-        sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], v45, v44, v43);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], v45, v44, v43);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n";
         v10 += 2 * LOBYTE(pFontArrus->uFontHeight) + 5;
@@ -2358,8 +2358,8 @@
             a2 = "%s\f%05u\r388%d\f00000 / %d\n";
         v49 = player->GetMaxHealth();
         v50 = UI_GetHealthManaStringColor(player->sHealth, v49);
-        sprintf(pTmpBuf, a2, pGlobalTXT_LocalizationStrings[108], v50, player->sHealth, v49);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[108], v50, player->sHealth, v49);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         a2a = "%s\f%05u\r424%d\f00000 /\t185%d\n";
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
@@ -2367,36 +2367,36 @@
             a2a = "%s\f%05u\r388%d\f00000 / %d\n";
         v53 = player->GetMaxMana();
         v54 = UI_GetHealthManaStringColor(player->sMana, v53);
-        sprintf(pTmpBuf, a2a, pGlobalTXT_LocalizationStrings[212], v54, player->sMana, v53);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), a2a, pGlobalTXT_LocalizationStrings[212], v54, player->sMana, v53);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
         v58 = player->GetBaseAC();
         v59 = player->GetActualAC();
         v60 = UI_GetHealthManaStringColor(v59, v58);
-        sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], v60, v59, v58);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], v60, v59, v58);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         v10 += 2 * LOBYTE(pFontArrus->uFontHeight) - 2;
         v62 = player->GetMajorConditionIdx();
         v64 = GetConditionDrawColor(v62);
-        sprintf(pTmpBuf, "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], v64, aCharacterConditionNames[v62]);
-        pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v10, 0, pTmpBuf, 226, 0);
+        sprintf(pTmpBuf.data(), "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], v64, aCharacterConditionNames[v62]);
+        pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v10, 0, pTmpBuf.data(), 226, 0);
 
         v10 += LOBYTE(pFontArrus->uFontHeight) + - 1;
         if (player->uQuickSpell)
             v67 = pSpellStats->pInfos[player->uQuickSpell].pShortName;
         else
             v67 = pGlobalTXT_LocalizationStrings[153];
-        sprintf(pTmpBuf, "%s: %s", pGlobalTXT_LocalizationStrings[172], v67);
-        pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v10, 0, pTmpBuf, 226, 0);
+        sprintf(pTmpBuf.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], v67);
+        pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v10, 0, pTmpBuf.data(), 226, 0);
 
         v10 = 50;
         v70 = player->GetBaseAge();
         v71 = player->GetActualAge();
         v72 = UI_GetHealthManaStringColor(v71, v70);
-        sprintf(pTmpBuf, "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], v72, v71, v70);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], v72, v71, v70);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         a2b = "%s\f%05u\t100%d\f00000 / %d\n";
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
@@ -2405,8 +2405,8 @@
         v75 = player->GetBaseLevel();
         v76 = player->GetActualLevel();
         v77 = UI_GetHealthManaStringColor(v76, v75);
-        sprintf(pTmpBuf, a2b, pGlobalTXT_LocalizationStrings[131], v77, v76, v75);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), a2b, pGlobalTXT_LocalizationStrings[131], v77, v76, v75);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
         if (player->uExperience <= 9999999)
@@ -2414,28 +2414,28 @@
         else
             v78 = pGlobalTXT_LocalizationStrings[17]; // "Exp."
         v81 = player->GetExperienceDisplayColor();
-        sprintf(pTmpBuf, "%s\r180\f%05d%lu\f00000\n\n", v78, v81, LODWORD(player->uExperience));
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), "%s\r180\f%05d%lu\f00000\n\n", v78, v81, LODWORD(player->uExperience));
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         v10 += 2 * LOBYTE(pFontArrus->uFontHeight);
         v83 = player->GetActualAttack(0);
-        sprintf(pTmpBuf, "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], v83);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], v83);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
         v85 = player->GetMeleeDamageString();
-        sprintf(pTmpBuf, "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], v85);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], v85);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
         v87 = player->GetRangedAttack();
-        sprintf(pTmpBuf, "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], v87);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], v87);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
         v89 = player->GetRangedDamageString();
-        sprintf(pTmpBuf, "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], v89);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], v89);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         a2c = format_4E2E10;
         v10 += 2 * LOBYTE(pFontArrus->uFontHeight) - 4;
@@ -2444,8 +2444,8 @@
         if ( v131 > 99 || v90 > 99 )
             a2c = "%s\f%05u\t180%d\f00000 / %d\n";
         v92 = UI_GetHealthManaStringColor(v131, v90);
-        sprintf(pTmpBuf, a2c, pGlobalTXT_LocalizationStrings[87], v92, v131, v90);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), a2c, pGlobalTXT_LocalizationStrings[87], v92, v131, v90);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         a2d = format_4E2E10;
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
@@ -2454,8 +2454,8 @@
         if ( v132 > 99 || v93 > 99 )
             a2d = "%s\f%05u\t180%d\f00000 / %d\n";
         v95 = UI_GetHealthManaStringColor(v132, v93);
-        sprintf(pTmpBuf, a2d, pGlobalTXT_LocalizationStrings[6], v95, v132, v93);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), a2d, pGlobalTXT_LocalizationStrings[6], v95, v132, v93);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         a2e = format_4E2E10;
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
@@ -2464,8 +2464,8 @@
         if ( v133 > 99 || v96 > 99 )
             a2e = "%s\f%05u\t180%d\f00000 / %d\n";
         v98 = UI_GetHealthManaStringColor(v133, v96);
-        sprintf(pTmpBuf, a2e, pGlobalTXT_LocalizationStrings[240], v98, v133, v96);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), a2e, pGlobalTXT_LocalizationStrings[240], v98, v133, v96);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         a2f = format_4E2E10;
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
@@ -2474,8 +2474,8 @@
         if ( v134 > 99 )
             a2f = "%s\f%05u\t180%d\f00000 / %d\n";
         v101 = UI_GetHealthManaStringColor(v134, v99);
-        sprintf(pTmpBuf, a2f, pGlobalTXT_LocalizationStrings[70], v101, v134, v99);
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        sprintf(pTmpBuf.data(), a2f, pGlobalTXT_LocalizationStrings[70], v101, v134, v99);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         a2g = format_4E2E10;
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
@@ -2484,13 +2484,13 @@
         if ( v135 > 99 || v102 > 99 )
             a2g = "%s\f%05u\t180%d\f00000 / %d\n";
         v104 = UI_GetHealthManaStringColor(v135, v102);
-        sprintf(pTmpBuf, a2g, pGlobalTXT_LocalizationStrings[142], v104, v135, v102);
+        sprintf(pTmpBuf.data(), a2g, pGlobalTXT_LocalizationStrings[142], v104, v135, v102);
         if ( player->classType == PLAYER_CLASS_LICH && v102 == 200 )
         {
             v106 = UI_GetHealthManaStringColor(v135, 200);
-            sprintf(pTmpBuf, format_4E2E00, pGlobalTXT_LocalizationStrings[142], v106, pGlobalTXT_LocalizationStrings[625]);
+            sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[142], v106, pGlobalTXT_LocalizationStrings[625]);
         }
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 
         a2h = format_4E2E10;
         v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
@@ -2499,13 +2499,13 @@
         if ( v136 > 99 || v107 > 99 )
             a2h = "%s\f%05u\t180%d\f00000 / %d\n";
         v109 = UI_GetHealthManaStringColor(v136, v107);
-        sprintf(pTmpBuf, a2h, pGlobalTXT_LocalizationStrings[29], v109, v136, v107);
+        sprintf(pTmpBuf.data(), a2h, pGlobalTXT_LocalizationStrings[29], v109, v136, v107);
         if ( player->classType == PLAYER_CLASS_LICH && v107 == 200 )
         {
             v111 = UI_GetHealthManaStringColor(v136, 200);
-            sprintf(pTmpBuf, format_4E2E00, pGlobalTXT_LocalizationStrings[29], v111, pGlobalTXT_LocalizationStrings[625]);
+            sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[29], v111, pGlobalTXT_LocalizationStrings[625]);
         }
-        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf, 0, 0, 0);
+        pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
 }
 
 bool awardSort (int i,int j) { 
@@ -2547,7 +2547,7 @@
         memset(achieved_awards.data(), 0, 4000);
         num_achieved_awards = 0;
 
-        memset(pTmpBuf2, 0, 0x7D0u);
+        memset(pTmpBuf2.data(), 0, 0x7D0u);
         BtnDown_flag = 0;
         BtnUp_flag = 0;
         dword_50651C = 0;
--- a/UIHouses.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UIHouses.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -492,8 +492,8 @@
 	current_npc_text = 0;
 	dword_F8B1E4 = 0;
 	dword_F8B1F4 = 0;
-	memset(byte_F8B1F0, 0, 4);
-	memset(player_levels, 0, 16);
+	memset(byte_F8B1F0.data(), 0, 4);
+	memset(player_levels.data(), 0, 16);
 	pRenderer->ClearZBuffer(0, 479);
 
 	if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour <uOpenTime)&&(pParty->uCurrentHour >(uCloseTime - 1))))||
@@ -512,9 +512,9 @@
 			uCloseTime -= 12;
 			am_pm_flag_close = 1;
 			}
-		sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open], 
+		sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open], 
 			uCloseTime, aAMPMNames[am_pm_flag_close]); //"This place is open from %d%s to %d%s"
-		ShowStatusBarString(pTmpBuf, 2u);
+		ShowStatusBarString(pTmpBuf.data(), 2u);
 		if ( uActiveCharacter )
 			pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0);
 		return 0;
@@ -1762,8 +1762,8 @@
       //v59 = pDialogueWindow;
       v54 = v17;
       strcpy(v48[4], "");
-      sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold
-      v18 = pFontArrus->CalcTextHeight(pTmpBuf2, &v53, 0, 0);
+      sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold
+      v18 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &v53, 0, 0);
       v19 = v16->pNumPresenceButton;
       v20 = v18 + v17 + 146;
       v21 = v16->pStartingPosActiveItem;
@@ -1824,16 +1824,16 @@
           if ( v23 != v2 )
           {
             memcpy(&v32, &pMapStats->pInfos[transport_schedule[v23].uMapInfoID], 0x44u);
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s
+            sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s
                       v66, v32.pName);
-            strcat(a1, pTmpBuf);
+            strcat(a1, pTmpBuf.data());
             v28 = a1;
             a1 += 100;
             ++v62;
             ++s1;
             strcat(v28, "\n \n");
             v24->uY = v63;
-            v29 = pFontArrus->CalcTextHeight(pTmpBuf, &v53, 0, 0);
+            v29 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v53, 0, 0);
             v30 = v24->uY;
             v24->uHeight = v29;
             v2 = 255;
@@ -1868,8 +1868,8 @@
         v45 = (unsigned int)&v49;
         v44 = &v48;
         v43 = pTmpBuf2;*/
-        sprintf(pTmpBuf, "%s\n \n%s%s%s%s%s", pTmpBuf2, v48[0], v48[1], v48[2], v48[3], v48[4]);
-        v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
+        sprintf(pTmpBuf.data(), "%s\n \n%s%s%s%s%s", pTmpBuf2, v48[0], v48[1], v48[2], v48[3], v48[4]);
+        v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
       }
       else
       {
@@ -1897,10 +1897,10 @@
       v5 = &transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][dialog_menu_id - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]];
       if ( v5->pSchedule[pParty->uDaysPlayed % 7] )
       {
-        if ( _stricmp(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename) )
+        if ( _stricmp(pCurrentMapName.data(), pMapStats->pInfos[v5->uMapInfoID].pFilename) )
         {
           SaveGame(1, 0);
-          strcpy(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename);
+          strcpy(pCurrentMapName.data(), pMapStats->pInfos[v5->uMapInfoID].pFilename);
 
           dword_6BE364_game_settings_1 |= 1u;
           _5B65B8_npcdata_hiword_house_or_other = 0;
@@ -2038,8 +2038,8 @@
   _this.uFrameZ = 334;
   v28 = TargetColor(0xFFu, 0xFFu, 0xFFu);
   v30 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-  sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
-  _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u);
+  sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
+  _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf.data(), 3u);
   switch(dialog_menu_id)
   {
 	case HOUSE_DIALOGUE_MAIN:
@@ -2069,7 +2069,7 @@
 		if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) )
 		{
 			v31 = 2;
-			v19 = pShopOptions;
+			v19 = pShopOptions.data();
 			do
 			{
 				v20 = v14->GetControl((unsigned int)pOutString);
@@ -2100,14 +2100,14 @@
 		v6 = TargetColor(0xFFu, 0xFFu, 0xFFu);
 		v7 = v5->pName;
 		v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-		sprintf(pTmpBuf, "\f%05d%s\f%05d", v8, v7, v6);
-		sprintf(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel);
-		current_npc_text = pTmpBuf2;
+		sprintf(pTmpBuf.data(), "\f%05d%s\f%05d", v8, v7, v6);
+		sprintf(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf, 100 * v5->uLevel);
+		current_npc_text = pTmpBuf2.data();
 		memcpy(&a1, pDialogueWindow, sizeof(a1));
 		w.uFrameWidth = 458;
 		w.uFrameZ = 457;
 		pOutString = pFontArrus;
-		v9 = pFontArrus->CalcTextHeight(pTmpBuf2, &w, 13, 0) + 7;
+		v9 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &w, 13, 0) + 7;
 		if ( 352 - v9 < 8 )
 		{
 			pOutString = pFontCreate;
@@ -2126,8 +2126,8 @@
 		v0 = window_SpeakInHouse;
 		if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
 		{
-			sprintfex(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); // "Pay"   "How Much?"
-			_this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u);
+			sprintfex(pTmpBuf.data(), "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); // "Pay"   "How Much?"
+			_this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf.data(), 3u);
 			_this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3);
 			v3 = pFontArrus;
 			v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
@@ -2200,8 +2200,8 @@
   _this.uFrameZ = 334;
   *(int *)v13 = TargetColor(0xFFu, 0xFFu, 0xFFu);
   *(int *)v14 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-  sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
-  _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u);
+  sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
+  _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf.data(), 3u);
   switch(dialog_menu_id)
   {
 	case HOUSE_DIALOGUE_MAIN:
@@ -2255,8 +2255,8 @@
 		}
 		v11 = pGlobalTXT_LocalizationStrings[112];
 		v10 = pGlobalTXT_LocalizationStrings[60];
-		sprintf(pTmpBuf, "%s\n%s", v10, v11);
-		_this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
+		sprintf(pTmpBuf.data(), "%s\n%s", v10, v11);
+		_this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf.data(), 3u);
 		_this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
 		v4 = pFontArrus;
 		v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
@@ -2299,8 +2299,8 @@
 		}
 		v11 = pGlobalTXT_LocalizationStrings[112];
 		v10 = pGlobalTXT_LocalizationStrings[244];
-		sprintfex(pTmpBuf, "%s\n%s", v10, v11);
-		_this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
+		sprintfex(pTmpBuf.data(), "%s\n%s", v10, v11);
+		_this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf.data(), 3u);
 		_this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
 		v4 = pFontArrus;
 		v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
@@ -2449,15 +2449,15 @@
           return;
 
       sprintf(pTopic1, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 2 ? pColorYellow : pColorWhite);
-      sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[178], pOutString); // Rent room for %d gold
-      strcat(pTopic1, pTmpBuf2);
+      sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[178], pOutString); // Rent room for %d gold
+      strcat(pTopic1, pTmpBuf2.data());
       pTopic1Height = pFontArrus->CalcTextHeight(pTopic1, &dialog_window, 0, 0);
       strcat(pTopic1, "\n \n");
 
       sprintf(pTopic2, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 3 ? pColorYellow : pColorWhite);
-      sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[86], // Buy food for %d days for %d gold
+      sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[86], // Buy food for %d days for %d gold
         (unsigned int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, v83);
-      strcat(pTopic2, pTmpBuf2);
+      strcat(pTopic2, pTmpBuf2.data());
       pTopic2Height = pFontArrus->CalcTextHeight(pTopic2, &dialog_window, 0, 0);
       strcat(pTopic2, "\n \n");
 
@@ -2518,8 +2518,8 @@
           pNumActiveItem++;
           if ( pNumActiveItem >= pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
           {
-            sprintfex(pTmpBuf, "%s%s%s%s", &pTopic1, &pTopic2, &pTopic3, &pTopic4);
-            dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf, 3);
+            sprintfex(pTmpBuf.data(), "%s%s%s%s", &pTopic1, &pTopic2, &pTopic3, &pTopic4);
+            dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf.data(), 3);
           }
         }
         while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
@@ -2529,33 +2529,33 @@
     case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
     {
       pOutString = pFontArrus;
-      strcpy(pTmpBuf, pNPCTopics[354].pText);
+      strcpy(pTmpBuf.data(), pNPCTopics[354].pText);
       dialog_window.uFrameWidth = game_viewport_width;
       dialog_window.uFrameZ = 452;
-      pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 12, 0) + 7;
+      pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
       if ( 352 - pTextHeight < 8 )
       {
         pOutString = pFontCreate;
-        pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf, &dialog_window, 12, 0) + 7;
+        pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
       }
       auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
       pRenderer->_4A6A68(8, 352 - pTextHeight, pTex, pTex->uTextureHeight - pTextHeight);
       pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
-      v63 = FitTextInAWindow(pTmpBuf, pOutString, &dialog_window, 0xCu, 0);
+      v63 = FitTextInAWindow(pTmpBuf.data(), pOutString, &dialog_window, 0xCu, 0);
       window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
       break;
     }
     case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
     {
-      strcpy(pTmpBuf, pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText);
+      strcpy(pTmpBuf.data(), pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText);
       dialog_window.uFrameWidth = game_viewport_width;
       dialog_window.uFrameZ = 452;
-      v61 = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 12, 0);
+      v61 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0);
       pTextHeight = v61 + 7;
       auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
       pRenderer->_4A6A68(8, 352 - (v61 + 7), pTex, pTex->uTextureHeight - (v61 + 7));
       pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
-      v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &dialog_window, 0xCu, 0);
+      v63 = FitTextInAWindow(pTmpBuf.data(), pFontArrus, &dialog_window, 0xCu, 0);
       window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
       break;
     }
@@ -2574,9 +2574,9 @@
       {
         v72 = pGlobalTXT_LocalizationStrings[639];// A tie!
       }
-      strcpy(pTmpBuf, v72);
-      v66 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
-      dialog_window.DrawTitleText(pFontArrus, 0, v66, pColorYellow, pTmpBuf, 3);
+      strcpy(pTmpBuf.data(), v72);
+      v66 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
+      dialog_window.DrawTitleText(pFontArrus, 0, v66, pColorYellow, pTmpBuf.data(), 3);
       break;
     }
     case HOUSE_DIALOGUE_TAVERN_REST:
@@ -2632,8 +2632,8 @@
         while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
         if ( v0 )
         {
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pItemNum);
-          dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
+          sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
+          dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
           v91 = (149 - all_text_height) / v0;
           if ( (149 - all_text_height) / v0 > 32 )
             v91 = 32;
@@ -2672,11 +2672,11 @@
           return;
         }
       }
-      sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
-      strcat(pTmpBuf, "\n \n");
-      strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
-      pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
-      dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorYellow, pTmpBuf, 3);
+      sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
+      strcat(pTmpBuf.data(), "\n \n");
+      strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
+      pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
+      dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorYellow, pTmpBuf.data(), 3);
       return;
     }
 
@@ -3206,11 +3206,11 @@
       pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
       if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
       {
-        sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
-        strcat(pTmpBuf, "\n \n");
-        strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
-        pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
-        dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf, 3);
+        sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
+        strcat(pTmpBuf.data(), "\n \n");
+        strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
+        pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
+        dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
         return;
       }
       do
@@ -3226,15 +3226,15 @@
       while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
       if ( !v0 )
       {
-        sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
-        strcat(pTmpBuf, "\n \n");
-        strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
-        pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
-        dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf, 3);
+        sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
+        strcat(pTmpBuf.data(), "\n \n");
+        strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
+        pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
+        dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
         return;
       }
-      sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pItemNum);
-      dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
+      sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
+      dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
       v103 = (149 - all_text_height) / v0;
       if ( (149 - all_text_height) / v0 > 32 )
         v103 = 32;
@@ -3775,11 +3775,11 @@
       v114 = 0;
       if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
       {
-        sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
-        strcat(pTmpBuf, "\n \n");
-        strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
-        v40 = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
-        dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf, 3);
+        sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
+        strcat(pTmpBuf.data(), "\n \n");
+        strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
+        v40 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
+        dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
         return;
       }
       do
@@ -3795,17 +3795,17 @@
       while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
       if ( !v114 )
       {
-        sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
-        strcat(pTmpBuf, "\n \n");
-        strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
-        v40 = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
-        dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf, 3);
+        sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
+        strcat(pTmpBuf.data(), "\n \n");
+        strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
+        v40 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
+        dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
         return;
       }
       if ( v114 )
       {
-        sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pItemNum);
-        dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
+        sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
+        dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
         v18 = (149 - all_text_height) / v114;
         if ( (149 - all_text_height) / v114 > 32 )
           v18 = 32;
@@ -4360,8 +4360,8 @@
         while ( (signed int)v39 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
         if ( v153 )
         {
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pActiveButton);
-          dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
+          sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pActiveButton);
+          dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
           pActiveButton = (149 - v152) / v153;
           if ( (149 - v152) / v153 > 32 )
             pActiveButton = 32;
@@ -4405,11 +4405,11 @@
           return;
         }
       }
-      sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); //"Seek knowledge elsewhere %s the %s"
-      strcat(pTmpBuf, "\n \n");
-      strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
-      v115 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
-      dialog_window.DrawTitleText(pFontArrus, 0, v115, pYellowColor, pTmpBuf, 3);
+      sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); //"Seek knowledge elsewhere %s the %s"
+      strcat(pTmpBuf.data(), "\n \n");
+      strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
+      v115 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
+      dialog_window.DrawTitleText(pFontArrus, 0, v115, pYellowColor, pTmpBuf.data(), 3);
       return;
     }
     break;
@@ -4503,8 +4503,8 @@
       {
         if ( pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] )
         {
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[403], pClassNames[dialog_menu_id - 16]); //"You already know the %s skill"
-          ShowStatusBarString(pTmpBuf, 2);
+          sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[403], pClassNames[dialog_menu_id - 16]); //"You already know the %s skill"
+          ShowStatusBarString(pTmpBuf.data(), 2);
           pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
         }
         else
@@ -4612,11 +4612,11 @@
   pItemNum = 0;
   if ( pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
   {
-    sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"	
-    strcat(pTmpBuf, "\n \n");
-    strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
-    v19 = pFontArrus->CalcTextHeight(pTmpBuf, &working_window, 0, 0);
-    working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorYellow, pTmpBuf, 3);
+    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"	
+    strcat(pTmpBuf.data(), "\n \n");
+    strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
+    v19 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &working_window, 0, 0);
+    working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
     return;
   }
   all_text_height = 0;
@@ -4643,17 +4643,17 @@
   while ( pActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
   if ( !v61 )
   {
-    sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"	
-    strcat(pTmpBuf, "\n \n");
-    strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
-    v19 = pFontArrus->CalcTextHeight(pTmpBuf, &working_window, 0, 0);
-    working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorYellow, pTmpBuf, 3);
+    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"	
+    strcat(pTmpBuf.data(), "\n \n");
+    strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
+    v19 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &working_window, 0, 0);
+    working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
     return;
   }
   if ( pSkillFlag )
   {
-    sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v63); //"Skill Cost: %lu"
-    working_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
+    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v63); //"Skill Cost: %lu"
+    working_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
   }
   v58 = (149 - all_text_height) / v61;
   if ( v58 > 32 )
@@ -4834,8 +4834,8 @@
               while ( (signed int)v62 < v4->pNumPresenceButton + v11 );
               if ( v65 )
               {
-                sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v64);
-                v57.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
+                sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v64);
+                v57.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
                 v64 = (149 - (signed int)v66) / (signed int)v65;
                 if ( v64 > 32 )
                   v64 = 32;
@@ -4886,12 +4886,12 @@
               else
               {
 LABEL_78:
-                sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
-                strcat(pTmpBuf, "\n \n");
-                strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
+                sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
+                strcat(pTmpBuf.data(), "\n \n");
+                strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
                 v22 = WORD2(v59);
-                v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v57, 0, 0);
-                v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
+                v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v57, 0, 0);
+                v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
               }
             }
           }
@@ -5245,8 +5245,8 @@
             while ( (signed int)v15 < v13->pNumPresenceButton + v13->pStartingPosActiveItem );
             if ( v72 )
             {
-              sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu"
-              v65.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
+              sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu"
+              v65.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
               v73 = (signed int)(149 - _v0) / v72;
               if ( v73 > 32 )
                 v73 = 32;
@@ -5293,13 +5293,13 @@
             else
             {
 LABEL_76:
-              sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// 
+              sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// 
                                                 // "Seek knowledge elsewhere %s the %s"
-              strcat(pTmpBuf, "\n \n");
-              strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
+              strcat(pTmpBuf.data(), "\n \n");
+              strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
               v29 = color2;
-              v30 = pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0);
-              v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf, 3u);
+              v30 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0);
+              v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf.data(), 3u);
             }
           }
         }
@@ -5350,9 +5350,9 @@
                 pOutdoor->SetFog();
             }
             pPlayers[uActiveCharacter]->PlaySound(SPEECH_87, 0);
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[430], pPlayers[uActiveCharacter]->pName, pPlayers[uActiveCharacter]->uLevel, pPlayers[uActiveCharacter]->uLevel / 10 + 5);// 
+            sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[430], pPlayers[uActiveCharacter]->pName, pPlayers[uActiveCharacter]->uLevel, pPlayers[uActiveCharacter]->uLevel / 10 + 5);// 
                                                 // "%s is now Level %lu and has earned %lu Skill Points!"
-            ShowStatusBarString(pTmpBuf, 2);
+            ShowStatusBarString(pTmpBuf.data(), 2);
             pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
             return;
           }
@@ -5374,24 +5374,24 @@
           pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
           return;
         }
-        sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[538], (unsigned int)(v5 - pPlayers[uActiveCharacter]->uExperience), v34 + 1);// 
+        sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[538], (unsigned int)(v5 - pPlayers[uActiveCharacter]->uExperience), v34 + 1);// 
                                                 // "You need %d more experience to train to level %d"
         v35 = 0;
         v62 = 3;
-        v60 = pTmpBuf;
+        v60 = pTmpBuf.data();
         v58 = color2;
-        v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 88;
+        v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0)) / 2 + 88;
       }
       else
       {
-        sprintf(pTmpBuf, "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);// 
+        sprintf(pTmpBuf.data(), "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);// 
                                                 // ""With your skills, you should be working here as a teacher.""
                                                 // ""Sorry, but we are unable to train you.""
         v35 = 0;
         v62 = 3;
-        v60 = pTmpBuf;
+        v60 = pTmpBuf.data();
         v58 = color2;
-        v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 101;
+        v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0)) / 2 + 101;
       }
       v65.DrawTitleText(pFontArrus, v35, v36, v58, v60, v62);
       v63 = 3;
@@ -5402,13 +5402,13 @@
     {
       v43 = pDialogueWindow;
       v72 = 0;
-      pShopOptions[0] = pTmpBuf;
+      pShopOptions[0] = pTmpBuf.data();
       pShopOptions[1] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
       v44 = pDialogueWindow->pNumPresenceButton;
       v73 = pDialogueWindow->pStartingPosActiveItem;
       if ( v73 < v73 + v44 )
       {
-        v45 = pShopOptions;
+        v45 = pShopOptions.data();
         do
         {
           if ( v43->GetControl(v73)->msg_param == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
@@ -5441,7 +5441,7 @@
       if (v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton)
       {
         int _v3 = 2;
-        v51 = pShopOptions;
+        v51 = pShopOptions.data();
         do
         {
           v52 = v43->GetControl(v73);
@@ -6019,12 +6019,12 @@
       v122 = 0;
       if ( (signed int)pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
       {
-        sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// 
+        sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// 
                                             // "Seek knowledge elsewhere %s the %s"
-        strcat(pTmpBuf, "\n \n");
-        strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
-        v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
-        dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf, 3);
+        strcat(pTmpBuf.data(), "\n \n");
+        strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
+        v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
+        dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf.data(), 3);
         return;
       }
       do
@@ -6040,16 +6040,16 @@
       while ( pActiveItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
       if ( !v122 )
       {
-        sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// 
+        sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// 
                                             // "Seek knowledge elsewhere %s the %s"
-        strcat(pTmpBuf, "\n \n");
-        strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
-        v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
-        dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf, 3);
+        strcat(pTmpBuf.data(), "\n \n");
+        strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
+        v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
+        dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf.data(), 3);
         return;
       }
-      sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu"
-      dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
+      sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu"
+      dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
       v119 = (const char **)((149 - all_text_height) / v122);
       if ( (149 - all_text_height) / v122 > 32 )
         v119 = (const char **)32;
--- a/UIMainMenu.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UIMainMenu.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -86,7 +86,7 @@
     pWindowList[i].eWindowType = WINDOW_null;
 
   uNumVisibleWindows = -1;
-  memset(pVisibleWindowsIdxs, 0, sizeof(pVisibleWindowsIdxs));
+  memset(pVisibleWindowsIdxs.data(), 0, sizeof(pVisibleWindowsIdxs));
 }
 
 //----- (004415C5) --------------------------------------------------------
--- a/UIOptions.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UIOptions.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -56,7 +56,7 @@
 OptionsMenuSkin options_menu_skin; // 507C60
 
 
-bool GameMenuUI_InvaligKeyBindingsFlags[28]; // 506E6C
+std::array<bool, 28> GameMenuUI_InvaligKeyBindingsFlags; // 506E6C
 //----- (00414D24) --------------------------------------------------------
 static unsigned int GameMenuUI_GetKeyBindingColor(int key_index)
 {
@@ -92,7 +92,7 @@
     if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
         {
         pPrevVirtualCidesMapping[uGameMenuUI_CurentlySelectedKeyIdx] = pKeyActionMap->pPressedKeysBuffer[0];
-        memset(GameMenuUI_InvaligKeyBindingsFlags, 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags));
+        memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags));
         v4 = 0;
         do
             {
--- a/UIPartyCreation.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UIPartyCreation.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -111,8 +111,8 @@
     for (uint i = 0; i < 4; ++i)
         for (uint j = 0; j < 56; ++j)
             {
-            sprintf(pTmpBuf, "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uCurrentFace], j + 1);
-            pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
+            sprintf(pTmpBuf.data(), "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uCurrentFace], j + 1);
+            pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
             }
 
         pTexture_PlayerFaceEradicated = pIcons_LOD->LoadTexturePtr("ERADCATE", TEXTURE_16BIT_PALETTE);
@@ -137,12 +137,12 @@
 
     result = 0;
     v3 = &pPlayerPortraitsNames[a2];
-    v4 = pTextures_PlayerFaces[a1];
+    v4 = pTextures_PlayerFaces[a1].data();
     do
         {
         v5 = result + 1;
-        sprintf(pTmpBuf, "%s%02d", *v3, result + 1);
-        pIcons_LOD->ReloadTexture(*v4, pTmpBuf, 2);
+        sprintf(pTmpBuf.data(), "%s%02d", *v3, result + 1);
+        pIcons_LOD->ReloadTexture(*v4, pTmpBuf.data(), 2);
         result = v5;
         ++v4;
         }
@@ -309,73 +309,73 @@
       case 2:  uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin"
       case 3:  uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf"
     }; 
-    strcpy(pTmpBuf, uRaceName);
-    pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX + 72, pIntervalY + 12, 0, pTmpBuf, 130, 0);//Race Name
+    strcpy(pTmpBuf.data(), uRaceName);
+    pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX + 72, pIntervalY + 12, 0, pTmpBuf.data(), 130, 0);//Race Name
 
     pTextCenter = pFontCreate->AlignText_Center(150, pText);
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); // Skills
 
     uStatLevel = player->GetActualMight();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], pX_Numbers, uStatLevel);// "Might"
+    sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], pX_Numbers, uStatLevel);// "Might"
     pStatColor = player->GetStatColor(0);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor, pTmpBuf, 0, 0, 0);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
 
     uStatLevel = player->GetActualIntelligence();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], pX_Numbers, uStatLevel);// "Intellect"
+    sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], pX_Numbers, uStatLevel);// "Intellect"
     pStatColor = player->GetStatColor(1);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
 
     uStatLevel = player->GetActualWillpower();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], pX_Numbers, uStatLevel);// "Personality"
+    sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], pX_Numbers, uStatLevel);// "Personality"
     pStatColor = player->GetStatColor(2);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
 
     uStatLevel = player->GetActualEndurance();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], pX_Numbers, uStatLevel);// "Endurance"
+    sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], pX_Numbers, uStatLevel);// "Endurance"
     pStatColor = player->GetStatColor(3);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
 
     uStatLevel = player->GetActualAccuracy();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], pX_Numbers, uStatLevel);// "Accuracy"
+    sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], pX_Numbers, uStatLevel);// "Accuracy"
     pStatColor = player->GetStatColor(4);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
 
     uStatLevel = player->GetActualSpeed();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], pX_Numbers, uStatLevel);// "Speed"
+    sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], pX_Numbers, uStatLevel);// "Speed"
     pStatColor = player->GetStatColor(5);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
 
     uStatLevel = player->GetActualLuck();
-    sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], pX_Numbers, uStatLevel);// "Luck"
+    sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], pX_Numbers, uStatLevel);// "Luck"
     pStatColor = player->GetStatColor(6);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
 
 
     pSkillsType = player->GetSkillIdxByOrder(0);
     pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
-    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0);
+    sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf.data(), 0, 0, 0);
 
     pSkillsType = player->GetSkillIdxByOrder(1);
     pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
-    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, uColorWhite, pTmpBuf, 0, 0, 0);
+    sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, uColorWhite, pTmpBuf.data(), 0, 0, 0);
 
     pSkillsType = player->GetSkillIdxByOrder(2);
     pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
-    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
+    sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
     pColorText = uColorGreen;
     if ( (signed int)pSkillsType >= 37 )
       pColorText = uColorTeal;
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, pTmpBuf, 0, 0, 0);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0);
 
     pSkillsType = player->GetSkillIdxByOrder(3);
     pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
-    sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
+    sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
     pColorText = uColorGreen;
     if ( (signed int)pSkillsType >= 37 )
       pColorText = uColorTeal;
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, pTmpBuf, 0, 0, 0);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0);
 
     //v124 = (char *)v124 + 1;
     pIntervalX += 159;
@@ -494,9 +494,9 @@
   pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus"
   pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, uColor1, pGlobalTXT_LocalizationStrings[30], 0, 0, 0);
   pBonusNum = PlayerCreation_ComputeAttributeBonus();
-  sprintf(pTmpBuf, "%d", pBonusNum);
-  pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), "%d", pBonusNum);
+  pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf.data());
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf.data(), 0, 0, 0);
   if ( GameUI_Footer_TimeLeft > GetTickCount() )
   {
     pWindow.Hint = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points."
@@ -556,8 +556,8 @@
   pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE);
   for(uX=0;uX < 22;++uX ) // load PlayerPortraits texture
   {
-    sprintf(pTmpBuf, "%s01", pPlayerPortraitsNames[uX]);
-    v1 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE);
+    sprintf(pTmpBuf.data(), "%s01", pPlayerPortraitsNames[uX]);
+    v1 = pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
     pPlayerPortraits[uX] = &pIcons_LOD->pTextures[v1];
 
   }
@@ -569,11 +569,11 @@
   uControlParam = 1;
   do
   {
-    sprintf(pTmpBuf, "arrowl%d", uControlParam);
-    pTextures_arrowl[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
+    sprintf(pTmpBuf.data(), "arrowl%d", uControlParam);
+    pTextures_arrowl[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
 
-    sprintf(pTmpBuf, "arrowr%d", uControlParam);
-    pTextures_arrowr[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
+    sprintf(pTmpBuf.data(), "arrowr%d", uControlParam);
+    pTextures_arrowr[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
   }
   while ( ++uControlParam < 20 );
   pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
--- a/UIPopup.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UIPopup.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -529,12 +529,12 @@
             wHintWindow.uFrameX -= 12;
             if ( v77 )
                 {
-                sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value"
+                sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value"
                 v40 = pFontComic;
                 v61 = 0;
                 v56 = 0;
                 v51 = 0;
-                v47 = pTmpBuf;
+                v47 = pTmpBuf.data();
                 v44 = 0;
                 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight);
                 v41 = 100;
@@ -544,31 +544,31 @@
                 if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
                     {
                     sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed);
-                    strcpy(pTmpBuf, "Duration:");
+                    strcpy(pTmpBuf.data(), "Duration:");
                     Str = (char *)(v67.field_18_expire_year - game_starting_year);
                     if (v67.field_18_expire_year != 1168 )
                         {
                         sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year);
-                        strcat(pTmpBuf, v65);
+                        strcat(pTmpBuf.data(), v65);
                         }
                     if ( (((v67.field_14_exprie_month || Str) && 
-                        ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str) 
+                        ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str) 
                         || v67.field_C_expire_day)
-                        && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || 
+                        && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str || 
                         v67.field_C_expire_day)
                         || v67.field_8_expire_hour)
-                        && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || 
+                        && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str || 
                         v67.field_C_expire_day || v67.field_8_expire_hour)
                         || v67.field_4_expire_minute )
                         {
                         sprintf(v65, " %d:mn", v67.field_4_expire_minute);
-                        strcat(pTmpBuf, v65);
+                        strcat(pTmpBuf.data(), v65);
                         }
-                    wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0);
+                    wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
                     }
                 v37 = inspect_item->GetValue();
-                sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37);
-                wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0);
+                sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37);
+                wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
                 v38 = inspect_item->uAttributes;
                 if ( BYTE1(v38) & 1 )
                     {
@@ -597,7 +597,7 @@
                 LOWORD(v38) = LOWORD(pRenderer->uTargetRMask);
                 v44 = v38;
                 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight);
-                v39 = pFontComic->GetLineWidth(pTmpBuf);
+                v39 = pFontComic->GetLineWidth(pTmpBuf.data());
                 v40 = pFontComic;
                 v41 = v39 + 132;
                 }
@@ -943,7 +943,7 @@
     //v37 = v6->uProfession;
     if (v6->uProfession)
     {
-      sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v6->pName, aNPCProfessionNames[v6->uProfession]); // "%s the %s"   /   ^Pi[%s] %s
+      sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], v6->pName, aNPCProfessionNames[v6->uProfession]); // "%s the %s"   /   ^Pi[%s] %s
     }
 	else
 	{
@@ -961,9 +961,9 @@
       v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName;
   }
   if(!v121->sNPC_ID || (v121->sNPC_ID && !v6->uProfession))
-    strncpy(pTmpBuf, v72, v77);
+    strncpy(pTmpBuf.data(), v72, v77);
   v39 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-  a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u);
+  a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf.data(), 3u);
   Actor::DrawHealthBar(v121, a1);
   v119 = 0;
   pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed;
@@ -1230,8 +1230,8 @@
   a4 = v106.uViewportY;
   if ( v119 )
   {
-    sprintf(pTmpBuf, "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP);
-    a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
+    sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP);
+    a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0);
     a4 = a4 + LOBYTE(v56->uFontHeight) - 3;
     v79 = v121->pMonsterInfo.uAC;
     v75 = 0;
@@ -1240,16 +1240,16 @@
   }
   else
   {
-    sprintf(pTmpBuf, "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]);
-    a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
+    sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]);
+    a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0);
     v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630];
     v75 = 0;
     v70 = pGlobalTXT_LocalizationStrings[12];
     a4 = a4 + LOBYTE(v56->uFontHeight) - 3;
     v67 = "%s\f%05u\t100%s\n";
   }
-  sprintf(pTmpBuf, v67, v70, v75, v79);
-  a1->DrawText(v56, 150, a4, a5, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), v67, v70, v75, v79);
+  a1->DrawText(v56, 150, a4, a5, pTmpBuf.data(), 0, 0, 0);
   a4 = a4 + LOBYTE(v56->uFontHeight) - 6 + LOBYTE(v56->uFontHeight);
   v95[0] = pGlobalTXT_LocalizationStrings[87];
   v95[1] = pGlobalTXT_LocalizationStrings[6];
@@ -1264,25 +1264,25 @@
   v95[10] = pGlobalTXT_LocalizationStrings[54];
   if ( v116 )
   {
-    sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]);
-    a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
+    sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]);
+    a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0);
     a4 = a4 + LOBYTE(v56->uFontHeight) - 3;
     v57 = v121->pMonsterInfo.uAttack1DamageBonus;
     if ( v57 )
-      sprintf(pTmpBuf, "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53],
+      sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53],
         0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides, v57);
     else
-      sprintf(pTmpBuf, "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53],
+      sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53],
         0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides);
   }
   else
   {
-    sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]);
-    a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
+    sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]);
+    a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0);
     a4 = a4 + LOBYTE(v56->uFontHeight) - 3;
-    sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]);
+    sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]);
   }
-  a1->DrawText(v56, 150, a4, a5, pTmpBuf, 0, 0, 0);
+  a1->DrawText(v56, 150, a4, a5, pTmpBuf.data(), 0, 0, 0);
   v58 = LOBYTE(v56->uFontHeight);
   a4 = a4 + v58 - 6 + v58;
   if ( !i )
@@ -1291,8 +1291,8 @@
     v76 = 0;
     v71 = pGlobalTXT_LocalizationStrings[628];
     v68 = "%s\f%05u\t080%s\n";
-    sprintf(pTmpBuf, v68, v71, v76, v80);
-    a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
+    sprintf(pTmpBuf.data(), v68, v71, v76, v80);
+    a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0);
     v58 = LOBYTE(v56->uFontHeight);
     a4 = a4 + v58 - 3;
   }
@@ -1305,8 +1305,8 @@
 		v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629];
 	  if ( v114 )
 	  {
-		sprintf(pTmpBuf, "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName);
-		a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
+		sprintf(pTmpBuf.data(), "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName);
+		a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0);
 		v58 = LOBYTE(v56->uFontHeight);
 		a4 = a4 + v58 - 3;
 		v59 = v121;
@@ -1314,8 +1314,8 @@
 	  v60 = v59->pMonsterInfo.uSpell2ID;
 	  if ( v60 )
 	  {
-		sprintf(pTmpBuf, "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName);
-		a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
+		sprintf(pTmpBuf.data(), "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName);
+		a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0);
 		v58 = LOBYTE(v56->uFontHeight);
 		a4 = a4 + v58 - 3;
 		v59 = v121;
@@ -1326,8 +1326,8 @@
 		v76 = 0;
 		v71 = pGlobalTXT_LocalizationStrings[628];
 		v68 = "%s\f%05u\t060%s\n";
-		sprintf(pTmpBuf, v68, v71, v76, v80);
-		a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
+		sprintf(pTmpBuf.data(), v68, v71, v76, v80);
+		a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0);
 		v58 = LOBYTE(v56->uFontHeight);
 		a4 = a4 + v58 - 3;
 	  }
@@ -1372,8 +1372,8 @@
         else
           v81 = pGlobalTXT_LocalizationStrings[153];
       }
-      sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[v124], 0, v81);
-      a1->DrawText(v56, 170, a4, a5, pTmpBuf, 0, 0, 0);
+      sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", v85[v124], 0, v81);
+      a1->DrawText(v56, 170, a4, a5, pTmpBuf.data(), 0, 0, 0);
       v63 = LOBYTE(v56->uFontHeight);
       v124 += 4;
       a4 = a4 + v63 - 3;
@@ -1385,8 +1385,8 @@
     i = 0;
     do
     {
-      sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?"
-      a1->DrawText(v56, 170, a4, a5, pTmpBuf, 0, 0, 0);
+      sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?"
+      a1->DrawText(v56, 170, a4, a5, pTmpBuf.data(), 0, 0, 0);
       v65 = LOBYTE(v56->uFontHeight);
       ++i;
       a4 = a4 + v65 - 3;
@@ -1395,9 +1395,9 @@
   }
   if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 )
   {
-    sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP);
-    pFontSmallnum->GetLineWidth(pTmpBuf);
-    a1->DrawTitleText(pFontSmallnum, 0, a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf, 3);
+    sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP);
+    pFontSmallnum->GetLineWidth(pTmpBuf.data());
+    a1->DrawTitleText(pFontSmallnum, 0, a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3);
   }
 }
 
@@ -1518,11 +1518,11 @@
         v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4);
         v34 = (int)((char *)v35 + 3);
         v17 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
-        v18 = *(int *)((char *)pGrandSkillDesc + v15);
-        v19 = *(int *)((char *)pMasterSkillDesc + v15);
-        v20 = *(int *)((char *)pExpertSkillDesc + v15);
-        v21 = *(int *)((char *)pNormalSkillDesc + v15);
-        v22 = *(int *)((char *)pSkillDesc + v15);
+        v18 = *(int *)(pGrandSkillDesc[v15]);
+        v19 = *(int *)(pMasterSkillDesc[v15]);
+        v20 = *(int *)(pExpertSkillDesc[v15]);
+        v21 = *(int *)(pNormalSkillDesc[v15]);
+        v22 = *(int *)(pSkillDesc[v15]);
         v23 = static_sub_417BB5_out_string;
         sprintf(
             static_sub_417BB5_out_string,
@@ -1637,33 +1637,33 @@
         sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[12], pArmourClassAttributeDescription);
       break;
     case 10:// Player Condition
-      strcpy(pTmpBuf2, pPlayerConditionAttributeDescription);
-      strcat(pTmpBuf2, "\n");
+      strcpy(pTmpBuf2.data(), pPlayerConditionAttributeDescription);
+      strcat(pTmpBuf2.data(), "\n");
       extern unsigned int pConditionImportancyTable[18];
       for ( uint i = 0; i < 18; ++i )
       {
         if ( pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]] )
         {
-          strcat(pTmpBuf2, " \n");
+          strcat(pTmpBuf2.data(), " \n");
           pHour = pParty->uTimePlayed - pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]];
           pHour = (unsigned int)((pHour * 0.234375) / 60 / 60);
           pDay = (unsigned int)pHour / 24;
           pHour %= 24i64;
           pTextColor = GetConditionDrawColor(pConditionImportancyTable[i]);
-          sprintfex(pTmpBuf, format_4E2DE8, pTextColor, aCharacterConditionNames[pConditionImportancyTable[i]]);
-          strcat(pTmpBuf2, pTmpBuf);
+          sprintfex(pTmpBuf.data(), format_4E2DE8, pTextColor, aCharacterConditionNames[pConditionImportancyTable[i]]);
+          strcat(pTmpBuf2.data(), pTmpBuf.data());
           if ( pHour && pHour <= 1 )
             pHourWord = pGlobalTXT_LocalizationStrings[109];
           else
             pHourWord = pGlobalTXT_LocalizationStrings[110];
           if ( !pDay || (pDayWord = pGlobalTXT_LocalizationStrings[56], pDay > 1) )
             pDayWord = pGlobalTXT_LocalizationStrings[57];
-          sprintfex(pTmpBuf, "%lu %s, %lu %s", pDay, pDayWord, pHour, pHourWord);
-          strcat(pTmpBuf2, pTmpBuf);
+          sprintfex(pTmpBuf.data(), "%lu %s, %lu %s", pDay, pDayWord, pHour, pHourWord);
+          strcat(pTmpBuf2.data(), pTmpBuf.data());
         }
       }
-      if ( pGlobalTXT_LocalizationStrings[47] && pTmpBuf2 )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[47], pTmpBuf2);
+      if ( pGlobalTXT_LocalizationStrings[47] && pTmpBuf2.data() )
+        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[47], pTmpBuf2.data());
       break;
     case 11:// Fast Spell
       if ( pGlobalTXT_LocalizationStrings[172] && pFastSpellAttributeDescription )
@@ -1689,14 +1689,14 @@
       pTmpBuf[0] = 0;
       pTmpBuf2[0] = 0;
       if ( v15 > pPlayers[uActiveCharacter]->uLevel )
-        sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[147], v15);
+        sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[147], v15);
       v16 = sub_4B46F8(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience);
-      sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[538], v16, v15 + 1);
-      strcat(pTmpBuf, "\n");
-      strcat(pTmpBuf, pTmpBuf2);
-      sprintf(pTmpBuf2, "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf);
-      if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2 )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2);
+      sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], v16, v15 + 1);
+      strcat(pTmpBuf.data(), "\n");
+      strcat(pTmpBuf.data(), pTmpBuf2.data());
+      sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf);
+      if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() )
+        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data());
       break;
     case 15:// Attack Bonus
       if ( pGlobalTXT_LocalizationStrings[587] && pAttackBonusAttributeDescription )
@@ -1797,7 +1797,7 @@
             v5 = v12;
         if ( v4 > v5 )
             v5 = v4;
-        sprintf(  pTmpBuf2,
+        sprintf(  pTmpBuf2.data(),
             "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s",
             v2->pDescription,
             pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL],
@@ -1812,7 +1812,7 @@
             pGlobalTXT_LocalizationStrings[LOCSTR_GRAND],
             v5 + 3,  v5 + 10,
             v2->pGrandmasterSkillDesc);
-        v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2, &a1, 0, 0);
+        v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &a1, 0, 0);
         a1.uFrameHeight += v6;
         if ( (signed int)a1.uFrameHeight < 150 )
             a1.uFrameHeight = 150;
@@ -1825,16 +1825,16 @@
         a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
         v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
         a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u);
-        a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0);
+        a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0);
         a1.uFrameWidth = 108;
         a1.uFrameZ = a1.uFrameX + 107;
         a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->lastOpenedSpellbookPage + 12], 3u);
-        sprintf( pTmpBuf,  "%s\n%d",    pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST],
+        sprintf( pTmpBuf.data(),  "%s\n%d",    pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST],
             pSpellDatas[spell_index + 11 * v1->lastOpenedSpellbookPage + 1].mana_per_skill[v1->pActiveSkills[v1->lastOpenedSpellbookPage + PLAYER_SKILL_FIRE]]);
         //  *(&[0].field_12 //temp_fix field_14
         // + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->lastOpenedSpellbookPage + 12]) >> 6)
         // + 10 * (int)((char *)v10 + 11 * v1->lastOpenedSpellbookPage)));
-        a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3u);
+        a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3u);
         dword_507B00_spell_info_to_draw_in_popup = 0;
         }
     // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup;
@@ -1932,9 +1932,9 @@
             {
             if ( !pPlayers[uActiveCharacter]->CanAct() )
                 {
-                sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s
+                sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s
                     pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//Опознать предметы
-                pWindow.Hint = pTmpBuf;
+                pWindow.Hint = pTmpBuf.data();
                 pWindow.uFrameWidth = 384;
                 pWindow.uFrameHeight = 180;
                 pWindow.uFrameY = 40;
@@ -2175,8 +2175,8 @@
                         if ( (signed int)pSkillId < 37 )
                             {
                             pSkillInfo = CharacterUI_GetSkillDescText(pButton->msg_param, (PLAYER_SKILL_TYPE)pSkillId);
-                            strcpy(pTmpBuf2, pSkillInfo);
-                            pWindow.Hint = pTmpBuf2;
+                            strcpy(pTmpBuf2.data(), pSkillInfo);
+                            pWindow.Hint = pTmpBuf2.data();
                             pStr = pSkillNames[pSkillId];
                             }
                         }
@@ -2201,8 +2201,8 @@
                 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1;
                 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1;
                 pColor = TargetColor(0xFF, 0xFF, 0x9B);
-                sprintf(pTmpBuf, format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n"
-                pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3);
+                sprintf(pTmpBuf.data(), format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n"
+                pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3);
                 pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0);
                 }
             break;
--- a/UIRest.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UIRest.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -91,7 +91,7 @@
         --uRestUI_FoodRequiredToRest;
     if ( uRestUI_FoodRequiredToRest < 1 )
         uRestUI_FoodRequiredToRest = 1;
-    if ( !_stricmp(pCurrentMapName, "d29.blv") && _449B57_test_bit(pParty->_quest_bits, 98) )
+    if ( !_stricmp(pCurrentMapName.data(), "d29.blv") && _449B57_test_bit(pParty->_quest_bits, 98) )
         uRestUI_FoodRequiredToRest = 0;
 
     ++pIcons_LOD->uTexturePacksCount;
@@ -175,8 +175,8 @@
         if (hourglass_icon_idx >= 120 )
             hourglass_icon_idx = 1;
 
-        sprintf(pTmpBuf, "hglas%03d", hourglass_icon_idx);
-        pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
+        sprintf(pTmpBuf.data(), "hglas%03d", hourglass_icon_idx);
+        pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
         pRenderer->DrawTextureIndexed(267, 159, pTexture_RestUI_CurrentHourglassFrame);
         memset(&tmp_button, 0, sizeof(GUIButton));
         tmp_button.uX = 24;
@@ -191,8 +191,8 @@
         tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent;
         tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, text_color, shadow_color);
         tmp_button.pParent = 0;
-        sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest);
-        pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, text_color, pTmpBuf, 0, 0, shadow_color);
+        sprintf(pTmpBuf.data(), "\r408%d", uRestUI_FoodRequiredToRest);
+        pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, text_color, pTmpBuf.data(), 0, 0, shadow_color);
         pButton_RestUI_WaitUntilDawn->DrawLabel(pGlobalTXT_LocalizationStrings[237], pFontCreate, text_color, shadow_color);
         pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, text_color, shadow_color);
         pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, text_color, shadow_color);
@@ -211,14 +211,14 @@
         tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, text_color, shadow_color);
         tmp_button.pParent = 0;
         v5 = (pParty->uCurrentHour >= 12 && pParty->uCurrentHour < 24)? 1:0;
-        sprintf(pTmpBuf, "%d:%02d %s", am_pm_hours, pParty->uCurrentMinute, aAMPMNames[v5]);
-        pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, text_color, pTmpBuf, 0, 0, shadow_color);
-        sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1);
-        pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, text_color, pTmpBuf, 0, 0, shadow_color);
-        sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1);
-        pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, text_color, pTmpBuf, 0, 0, shadow_color);
-        sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear);
-        pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, text_color, pTmpBuf, 0, 0, shadow_color);
+        sprintf(pTmpBuf.data(), "%d:%02d %s", am_pm_hours, pParty->uCurrentMinute, aAMPMNames[v5]);
+        pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, text_color, pTmpBuf.data(), 0, 0, shadow_color);
+        sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1);
+        pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, text_color, pTmpBuf.data(), 0, 0, shadow_color);
+        sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1);
+        pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, text_color, pTmpBuf.data(), 0, 0, shadow_color);
+        sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear);
+        pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, text_color, pTmpBuf.data(), 0, 0, shadow_color);
         if ( dword_506F14 )
             Sleep6Hours();
         }
--- a/UISaveLoad.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UISaveLoad.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -180,8 +180,8 @@
     auto ampm = aAMPMNames[HIDWORD(pAMPM2)];
     auto month = aMonthNames[pMonthNum];
     //sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID);
-    sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", day, pHour, pMinutes, ampm, 7 * v16 + HIDWORD(pOurHour) % 7 + 1, month, pYear);
-    pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf, 3u);
+    sprintf(pTmpBuf.data(), "%s %d:%02d%s\n%d %s %d", day, pHour, pMinutes, ampm, 7 * v16 + HIDWORD(pOurHour) % 7 + 1, month, pYear);
+    pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf.data(), 3u);
     v1 = 255;
   }
   if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
@@ -323,14 +323,14 @@
     for (uint i = 0; i < uNumSavegameFiles; ++i)
         {
 
-        sprintf(pTmpBuf, "saves\\%s", pSavegameList->pFileList[i].pSaveFileName);
-        if (_access(pTmpBuf, 6))
+        sprintf(pTmpBuf.data(), "saves\\%s", pSavegameList->pFileList[i].pSaveFileName);
+        if (_access(pTmpBuf.data(), 6))
             {
             pSavegameUsedSlots[i] = 0;
             strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[72]); // "Empty"
             continue;
             }
-        pLODFile.LoadFile(pTmpBuf, 1);
+        pLODFile.LoadFile(pTmpBuf.data(), 1);
         v4 = pLODFile.FindContainer("header.bin", true);
         if ( v4 )
             fread(&pSavegameHeader[i], 0x64, 1, v4);
@@ -425,15 +425,15 @@
         v3 = pSavegameList->pFileList[i].pSaveFileName;
         if ( !*pSavegameList->pFileList[i].pSaveFileName )
             v3 = "1.mm7";
-        sprintf(pTmpBuf, "saves\\%s", v3);
-        if ( _access(pTmpBuf, 0) || _access(pTmpBuf, 6) )
+        sprintf(pTmpBuf.data(), "saves\\%s", v3);
+        if ( _access(pTmpBuf.data(), 0) || _access(pTmpBuf.data(), 6) )
             {
             pSavegameUsedSlots[i] = 0;
             strcpy(pSavegameHeader[i].pName, pGlobalTXT_LocalizationStrings[LOCSTR_EMPTY]);
             }
         else
             {
-            v11.LoadFile(pTmpBuf, 1);
+            v11.LoadFile(pTmpBuf.data(), 1);
             v4 = v11.FindContainer("header.bin", 1);
             fread(&pSavegameHeader[i], 100, 1u, v4);
             v5 = v11.FindContainer("image.pcx", 1);
--- a/UITransition.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UITransition.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -108,10 +108,10 @@
   }
   else if ( !v23 )
   {
-      v14 = pMapStats->GetMapInfo(pCurrentMapName);
+      v14 = pMapStats->GetMapInfo(pCurrentMapName.data());
       if ( v14 )
       {
-        sprintfex(sHouseName, pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v14].pName); // "Leave %s"
+        sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v14].pName); // "Leave %s"
         goto LABEL_20;
       }
       v21 = pGlobalTXT_LocalizationStrings[79];
@@ -119,18 +119,18 @@
   }
   v15 = pLocationName;
   if ( *pLocationName == 48 )
-    v15 = pCurrentMapName;
+    v15 = pCurrentMapName.data();
   v16 = pMapStats->GetMapInfo(v15);
   if ( v16 )
   {
-    sprintfex(sHouseName, pGlobalTXT_LocalizationStrings[411], pMapStats->pInfos[v16].pName);
+    sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[411], pMapStats->pInfos[v16].pName);
     goto LABEL_20;
   }
   v21 = pGlobalTXT_LocalizationStrings[73];
 LABEL_19:
-  strcpy(sHouseName, v21);
+  strcpy(sHouseName.data(), v21);
 LABEL_20:
-  pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Transition, 0, (int)sHouseName);
+  pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Transition, 0, (int)sHouseName.data());
   //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) )
   if ( pAnimatedRooms[p2DEvents[anim_id - 1].uAnimationID].uRoomSoundId )
     PlayHouseSound(anim_id, HouseSound_Greeting);
@@ -164,12 +164,12 @@
 
   pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
   pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE);
-  v1 = pMapStats->GetMapInfo(pCurrentMapName);
+  v1 = pMapStats->GetMapInfo(pCurrentMapName.data());
   if ( v1 )
-    sprintfex(sHouseName, pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
+    sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
   else
-    strcpy(sHouseName, pGlobalTXT_LocalizationStrings[79]);// "Exit"
-  pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ChangeLocation, 0, (int)sHouseName);
+    strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);// "Exit"
+  pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ChangeLocation, 0, (int)sHouseName.data());
 }
 
 
@@ -188,7 +188,7 @@
   unsigned int v9; // [sp+80h] [bp-4h]@1
 
   memcpy(&v7, pPrimaryWindow, sizeof(v7));
-  v9 = pMapStats->GetMapInfo(pCurrentMapName);
+  v9 = pMapStats->GetMapInfo(pCurrentMapName.data());
   pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
   v0 = pMapStats->GetMapInfo(pDestinationMapName);
   pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
@@ -217,12 +217,12 @@
       v6 = v3;
       v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s."
     }
-    sprintfex(pTmpBuf, v5, v6, v1->pName);
-    strcat(pTmpBuf, "\n \n");
-    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName);
-    strcat(pTmpBuf, pTmpBuf2);
-    v4 = pFontCreate->CalcTextHeight(pTmpBuf, &v7, 0, 0);
-    v7.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf, 3);
+    sprintfex(pTmpBuf.data(), v5, v6, v1->pName);
+    strcat(pTmpBuf.data(), "\n \n");
+    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName);
+    strcat(pTmpBuf.data(), pTmpBuf2.data());
+    v4 = pFontCreate->CalcTextHeight(pTmpBuf.data(), &v7, 0, 0);
+    v7.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf.data(), 3);
     _unused_5B5924_is_travel_ui_drawn = 1;
   }
 }
@@ -245,7 +245,7 @@
   int a3; // [sp+6Bh] [bp-1h]@11
 
   memcpy(&v8, pPrimaryWindow, sizeof(v8));
-  v10 = pMapStats->GetMapInfo(pCurrentMapName);
+  v10 = pMapStats->GetMapInfo(pCurrentMapName.data());
   v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
   pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
   pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, pIcons_LOD->GetTexture(uTextureID_50795C));
@@ -274,9 +274,9 @@
   }
   else if ( v10 )
   {
-    sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[409], pMapInfo->pName);// "Do you wish to leave %s?"
-    v4 = (212 - pFontCreate->CalcTextHeight(pTmpBuf, &v8, 0, 0)) / 2 + 101;
-    v8.DrawTitleText(pFontCreate, 0, v4, 0, pTmpBuf, 3);
+    sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[409], pMapInfo->pName);// "Do you wish to leave %s?"
+    v4 = (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &v8, 0, 0)) / 2 + 101;
+    v8.DrawTitleText(pFontCreate, 0, v4, 0, pTmpBuf.data(), 3);
   }
   else assert(false);
 
--- a/UiGame.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/UiGame.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -294,8 +294,8 @@
         a1.uFrameWidth = 400;
         a1.uFrameZ = a1.uFrameX + 399;
         a1.DrawMessageBox(0);
-        sprintfex(pTmpBuf2, "NPC%03d", v6->uPortraitID);
-        v8 = pIcons_LOD->LoadTexture(pTmpBuf2, TEXTURE_16BIT_PALETTE);
+        sprintfex(pTmpBuf2.data(), "NPC%03d", v6->uPortraitID);
+        v8 = pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE);
         pRenderer->DrawTextureIndexed(
           a1.uFrameX + 22,
           a1.uFrameY + 36,
@@ -304,14 +304,14 @@
         if ( v9 )
         {
           v10 = v6->pName;
-          v11 = pTmpBuf;
-          sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v10, aNPCProfessionNames[v9]);
+          v11 = pTmpBuf.data();
+          sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], v10, aNPCProfessionNames[v9]);
         }
         else
         {
           v12 = v6->pName;
-          v11 = pTmpBuf;
-          strcpy(pTmpBuf, v12);
+          v11 = pTmpBuf.data();
+          strcpy(pTmpBuf.data(), v12);
         }
         v13 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
         a1.DrawTitleText(pFontArrus, 0, 0xCu, v13, v11, 3u);
@@ -498,13 +498,13 @@
 
   if (pNPC->uProfession)
   {
-    assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames)); // sometimes buffer overflows; errors emerge both here and in dialogue text
-    sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s
+    assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames.data())); // sometimes buffer overflows; errors emerge both here and in dialogue text
+    sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s
   }
   else
-    strcpy(pTmpBuf, pNPC->pName);
+    strcpy(pTmpBuf.data(), pNPC->pName);
 
-  v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3);
+  v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf.data(), 3);
   pParty->GetPartyFame();
 
   pInString = nullptr;
@@ -537,8 +537,8 @@
     break;
 
     case DIALOGUE_ARENA_REWARD:
-      sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[576], gold_transaction_amount);// "Congratulations on your win: here's your stuff: %u gold."
-      pInString = pTmpBuf;
+      sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[576], gold_transaction_amount);// "Congratulations on your win: here's your stuff: %u gold."
+      pInString = pTmpBuf.data();
     break;
 
     case DIALOGUE_ARENA_ALREADY_WON:
@@ -798,20 +798,20 @@
 
   pFont = pFontArrus;
   if ( current_npc_text && !byte_5B0938[0] )
-    strcpy(byte_5B0938, current_npc_text);
+    strcpy(byte_5B0938.data(), current_npc_text);
   v5.uFrameWidth = game_viewport_width;
   v5.uFrameZ = 452;
-  v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
+  v1 = pFontArrus->CalcTextHeight(byte_5B0938.data(), &v5, 12, 0) + 7;
   if ( 352 - v1 < 8 )
   {
     pFont = pFontCreate;
-    v1 = pFontCreate->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
+    v1 = pFontCreate->CalcTextHeight(byte_5B0938.data(), &v5, 12, 0) + 7;
   }
   pRenderer->_4A6A68(8, 352 - v1,
     pIcons_LOD->GetTexture(uTextureID_Leather),
     pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - v1);
   pRenderer->DrawTextureIndexed(8, 347 - v1, pTexture_591428);
-  v2 = FitTextInAWindow(byte_5B0938, pFont, &v5, 0xCu, 0);
+  v2 = FitTextInAWindow(byte_5B0938.data(), pFont, &v5, 0xCu, 0);
   pGUIWindow2->DrawText(pFont, 12, 354 - v1, 0, v2, 0, 0, 0);
   pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
   if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
@@ -819,7 +819,7 @@
     if ( pGUIWindow2->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
     {
       pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
-      strcpy(GameUI_Footer_TimedString, (const char *)pKeyActionMap->pPressedKeysBuffer);
+      strcpy(GameUI_Footer_TimedString.data(), (const char *)pKeyActionMap->pPressedKeysBuffer);
 LABEL_16:
       sub_4452BB();
       return;
@@ -828,7 +828,7 @@
       return;
     pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
 LABEL_15:
-    memset(GameUI_Footer_TimedString, 0, 0xC8u);
+    memset(GameUI_Footer_TimedString.data(), 0, 0xC8u);
     goto LABEL_16;
   }
   if ( pGUIWindow2->ptr_1C == (void *)26 )
@@ -892,7 +892,7 @@
   if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || (*(float *)&v23 = 0.0, (signed int)v1 <= 0) )
   {
 LABEL_14:
-    v17 = pMapStats->GetMapInfo(pCurrentMapName);
+    v17 = pMapStats->GetMapInfo(pCurrentMapName.data());
     if ( v17 == v2 )
       result = "No Maze Info for this maze on file!";
     else
@@ -1022,38 +1022,38 @@
 
   pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13);
 
-  sprintfex(pTmpBuf, "\f%05d", ui_character_header_text_color);
-  sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s"
-  strcat(pTmpBuf, pTmpBuf2);
-  strcat(pTmpBuf, "\f00000\n");
+  sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color);
+  sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s"
+  strcat(pTmpBuf.data(), pTmpBuf2.data());
+  strcat(pTmpBuf.data(), "\f00000\n");
 
   v20 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth());
-  sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n",
+  sprintf(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n",
           pGlobalTXT_LocalizationStrings[108], // "Hit Points"
           v20, player->sHealth, player->GetMaxHealth());
-  strcat(pTmpBuf, pTmpBuf2);
+  strcat(pTmpBuf.data(), pTmpBuf2.data());
 
   v24 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana());
-  sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n",
+  sprintf(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n",
           pGlobalTXT_LocalizationStrings[212], // "Spell Points"
           v24, player->sMana, player->GetMaxMana());
-  strcat(pTmpBuf, pTmpBuf2);
+  strcat(pTmpBuf.data(), pTmpBuf2.data());
 
   v25 = player->GetMajorConditionIdx();
-  sprintf(pTmpBuf2, "%s: \f%05d%s\f00000\n",
+  sprintf(pTmpBuf2.data(), "%s: \f%05d%s\f00000\n",
           pGlobalTXT_LocalizationStrings[47], // "Condition
           GetConditionDrawColor(v25), aCharacterConditionNames[v25]);
-  strcat(pTmpBuf, pTmpBuf2);
+  strcat(pTmpBuf.data(), pTmpBuf2.data());
 
   v28 = player->uQuickSpell;
   if ( v28 )
     v29 = pSpellStats->pInfos[v28].pShortName;
   else
     v29 = pGlobalTXT_LocalizationStrings[153];
-  sprintfex(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell"
-  strcat(pTmpBuf, pTmpBuf2);
+  sprintfex(pTmpBuf2.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell"
+  strcat(pTmpBuf.data(), pTmpBuf2.data());
 
-  window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0);
+  window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf.data(), 0, 0, 0);
 
   uFramesetIDa = 0;
   for (uint i = 0; i < 24; ++i)
@@ -1072,8 +1072,8 @@
   v39 = "";
   if ( uFramesetIDa == 0 )
     v39 = pGlobalTXT_LocalizationStrings[153]; // "None"
-  sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s"
-  window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s"
+  window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf.data(), 0, 0, 0);
 }
 
 
@@ -1148,12 +1148,12 @@
             pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * v43 + 89, 0x12u, ui_character_header_text_color, player->pName, 84, 0);
             if ( v43 == 0 )
                 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x2Fu, 0, pGlobalTXT_LocalizationStrings[131], 60, 0); //Уров.
-            sprintf(pTmpBuf, "%lu", player->GetActualLevel());
+            sprintf(pTmpBuf.data(), "%lu", player->GetActualLevel());
             if ( player->GetActualLevel() <= player->GetBaseLevel())
                 v5 = player->GetExperienceDisplayColor();
             else
               v5 = ui_character_bonus_text_color;
-            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf, 84, 0);
+            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf.data(), 84, 0);
             v6 = v45 + 47;
             if ( v43 == 0 )
                 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v45 + 47, 0, pGlobalTXT_LocalizationStrings[41], 60, 0);//Класс
@@ -1161,26 +1161,26 @@
             v7 = v45 + v6;
             if ( v43 == 0 )
                 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v7, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//Здор.
-            sprintf(pTmpBuf, "%d", player->sHealth);
+            sprintf(pTmpBuf.data(), "%d", player->sHealth);
             v9 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth());
-            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf, 84, 0);
+            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf.data(), 84, 0);
             v10 = v45 + v7;
             if ( v43 == 0 )
                 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v10, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);//Мана
-            sprintf(pTmpBuf, "%d", player->sMana);
+            sprintf(pTmpBuf.data(), "%d", player->sMana);
             v12 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana());
-            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf, 84, 0);
+            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf.data(), 84, 0);
             v13 = v45 + v10;
             if ( v43 == 0 )
                 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v13, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);//Класс брони
-            sprintf(pTmpBuf, "%d", player->GetActualAC());
+            sprintf(pTmpBuf.data(), "%d", player->GetActualAC());
             v18 = UI_GetHealthManaStringColor(player->GetActualAC(), player->GetBaseAC());
-            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf, 84, 0);
+            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf.data(), 84, 0);
             v19 = v45 + v13;
             if ( !v43 )
                 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v19, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);//Атака
-            sprintf(pTmpBuf, "%+d", player->GetActualAttack(0));
-            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v19, 0, pTmpBuf, 84, 0);
+            sprintf(pTmpBuf.data(), "%+d", player->GetActualAttack(0));
+            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v19, 0, pTmpBuf.data(), 84, 0);
             v21 = v45 + v19;
             if ( !v43 )
                 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v21, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Повр.
@@ -1189,8 +1189,8 @@
             v23 = v45 + v21;
             if ( !v43 )
                 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v23, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// Стрелять
-            sprintf(pTmpBuf, "%+d", player->GetRangedAttack());
-            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v23, 0, pTmpBuf, 84, 0);
+            sprintf(pTmpBuf.data(), "%+d", player->GetRangedAttack());
+            pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v23, 0, pTmpBuf.data(), 84, 0);
             v25 = v45 + v23;
             if ( !v43 )
                 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v25, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Повр.
@@ -1210,13 +1210,13 @@
                 --v30;
                 }
                 while ( v30 );
-                sprintf(pTmpBuf, "%lu", v28);
-                pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v27, 0, pTmpBuf, 84, 0);
+                sprintf(pTmpBuf.data(), "%lu", v28);
+                pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v27, 0, pTmpBuf.data(), 84, 0);
                 v31 = v45 + v27;
                 if ( !v43 )
                     pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v31, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);//Очки
-                sprintf(pTmpBuf, "%lu", player->uSkillPoints);
-                pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, pTmpBuf, 84, 0);
+                sprintf(pTmpBuf.data(), "%lu", player->uSkillPoints);
+                pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, pTmpBuf.data(), 84, 0);
                 v32 = v45 + v31;
                 v48 = player->GetMajorConditionIdx();
                 if ( !v43 )
@@ -1247,11 +1247,11 @@
             else
               v39 = ui_character_bonus_text_color;
 
-            sprintf(pTmpBuf, "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], v39, GetReputationString(v38));//Reputation
-            pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf, 0, 0, 0);
+            sprintf(pTmpBuf.data(), "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], v39, GetReputationString(v38));//Reputation
+            pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf.data(), 0, 0, 0);
 
-            sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], pParty->GetPartyFame());// Fame Слава
-            pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf, 0, 0, 0);
+            sprintf(pTmpBuf.data(), "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], pParty->GetPartyFame());// Fame Слава
+            pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf.data(), 0, 0, 0);
 }
 
 
@@ -1290,10 +1290,10 @@
   if ( uGameState != GAME_STATE_FINAL_WINDOW )
   {
     v2 = sub_44100D() != 0 ? 381 : 322;
-    sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations);
-    pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow);
-    sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold);
-    pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow);
+    sprintf(pTmpBuf.data(), "\r087%lu", pParty->uNumFoodRations);
+    pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf.data(), 0, 0, uGameUIFontShadow);
+    sprintf(pTmpBuf.data(), "\r028%lu", pParty->uNumGold);
+    pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf.data(), 0, 0, uGameUIFontShadow);
   }
 }
 
@@ -1392,12 +1392,12 @@
 
   pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar);
   if (GameUI_Footer_TimeLeft)
-    v1 = GameUI_Footer_TimedString;
+    v1 = GameUI_Footer_TimedString.data();
   else
   {
     if (!pFooterString[0])
       return;
-    v1 = pFooterString;
+    v1 = pFooterString.data();
   }
 
   v5 = pFontLucida->AlignText_Center(450, v1);
@@ -1416,18 +1416,18 @@
         {
         if ( GameUI_Footer_TimeLeft )
             {
-            for ( i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString);
+            for ( i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data());
                 i > 450;
-                i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString) )
-                byte_5C3427[strlen(GameUI_Footer_TimedString)] = 0;
+                i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()) )
+                byte_5C3427[strlen(GameUI_Footer_TimedString.data())] = 0;
             }
         else
             {
-            strcpy(pFooterString, v1);
-            for ( j = pFontLucida->GetLineWidth(pFooterString);
+            strcpy(pFooterString.data(), v1);
+            for ( j = pFontLucida->GetLineWidth(pFooterString.data());
                 j > 450;
-                j = pFontLucida->GetLineWidth(pFooterString) )
-                GameUI_Footer_TimedString[strlen(pFooterString) + 199] = 0;
+                j = pFontLucida->GetLineWidth(pFooterString.data()) )
+                GameUI_Footer_TimedString[strlen(pFooterString.data()) + 199] = 0;
             }
         }
     }
@@ -1453,28 +1453,28 @@
         pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar);
         if ( GameUI_Footer_TimeLeft )
             {
-            v1 = GameUI_Footer_TimedString;
-            v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString);
+            v1 = GameUI_Footer_TimedString.data();
+            v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data());
             v3 = 450;
             while ( v2 > 450 )
                 {
-                v4 = strlen(GameUI_Footer_TimedString);
+                v4 = strlen(GameUI_Footer_TimedString.data());
                 v5 = pFontLucida;
                 byte_5C3427[v4] = 0;
-                v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString);
+                v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data());
                 }
             }
         else
             {
-            v1 = pFooterString;
-            v6 = pFontLucida->GetLineWidth(pFooterString);
+            v1 = pFooterString.data();
+            v6 = pFontLucida->GetLineWidth(pFooterString.data());
             v3 = 450;
             while ( v6 > 450 )
                 {
-                v7 = strlen(pFooterString);
+                v7 = strlen(pFooterString.data());
                 v8 = pFontLucida;
                 GameUI_Footer_TimedString[v7 + 199] = 0;
-                v6 = pFontLucida->GetLineWidth(pFooterString);
+                v6 = pFontLucida->GetLineWidth(pFooterString.data());
                 }
             }
         v9 = *v1 == 0;
@@ -1618,8 +1618,8 @@
         return;
       }
       v31 = pSpriteObjects[v30].stru_24.GetDisplayName();
-      v28 = pTmpBuf;
-      sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s"
+      v28 = pTmpBuf.data();
+      sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[470], v31);// "Get %s"
     }
     else
     {
@@ -1803,13 +1803,13 @@
         return;
       }
       pActor = &pActors[v19];
-      v28 = pTmpBuf;
+      v28 = pTmpBuf.data();
       v29 = pActor->dword_000334_unique_name;
       if ( v29 )
         v40 = pMonsterStats->pPlaceStrings[v29];
       else
         v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName;
-      strncpy(pTmpBuf, v40, 0x7D0u);
+      strncpy(pTmpBuf.data(), v40, 0x7D0u);
     }
     v26 = v28;
 //LABEL_87:
--- a/VideoPlayer.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/VideoPlayer.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -481,30 +481,30 @@
   GetDllVersion(L"BINKW32.DLL", &uBinkVersionMajor, &uBinkVersionMinor);
   uBinkVersion = (unsigned __int64)uBinkVersionMajor << 32 | uBinkVersionMinor;
 
-  strcpy(pTmpBuf, "anims\\might7.vid");
+  strcpy(pTmpBuf.data(), "anims\\might7.vid");
   hMightVid = CreateFileW(L"anims\\might7.vid", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0x8000080u, 0);
   if ( hMightVid == INVALID_HANDLE_VALUE )
   {
-    sprintf(pTmpBuf2, "Can't open file - anims\\%s.smk", pTmpBuf);
-    MessageBoxA(0, pTmpBuf2, "Video File Error", 0);
+    sprintf(pTmpBuf2.data(), "Can't open file - anims\\%s.smk", pTmpBuf);
+    MessageBoxA(0, pTmpBuf2.data(), "Video File Error", 0);
     return;
   }
-  strcpy(pTmpBuf, "anims\\magic7.vid");
+  strcpy(pTmpBuf.data(), "anims\\magic7.vid");
   hMagicVid = CreateFileW(L"anims\\magic7.vid", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0x8000080u, 0);
   if ( hMagicVid == INVALID_HANDLE_VALUE )
   {
     if ( !bCanLoadFromCD )
       {
-       sprintf(pTmpBuf2, "Can't open file - anims\\%s.smk", pTmpBuf);
-       MessageBoxA(0, pTmpBuf2, "Video File Error", 0);
+       sprintf(pTmpBuf2.data(), "Can't open file - anims\\%s.smk", pTmpBuf);
+       MessageBoxA(0, pTmpBuf2.data(), "Video File Error", 0);
        return;
 	  }
-    sprintf(pTmpBuf2, "%c:\\%s", (unsigned __int8)cMM7GameCDDriveLetter, pTmpBuf);
-    hMagicVid = CreateFileA(pTmpBuf2, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0x8000080u, 0);
+    sprintf(pTmpBuf2.data(), "%c:\\%s", (unsigned __int8)cMM7GameCDDriveLetter, pTmpBuf);
+    hMagicVid = CreateFileA(pTmpBuf2.data(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0x8000080u, 0);
     if ( hMagicVid == (HANDLE)INVALID_HANDLE_VALUE )
     {
-	  sprintf(pTmpBuf2, "Can't open file - %s", pTmpBuf);
-      MessageBoxA(0, pTmpBuf2, "Video File Error", 0);
+	  sprintf(pTmpBuf2.data(), "Can't open file - %s", pTmpBuf);
+      MessageBoxA(0, pTmpBuf2.data(), "Video File Error", 0);
       return;
     }
   }
@@ -975,9 +975,9 @@
     if ( !v5 )
     {
       v3->Unload();
-      sprintf(pTmpBuf, "Can't load %s", &Str2);
+      sprintf(pTmpBuf.data(), "Can't load %s", &Str2);
       v15 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Video.cpp:937";
-      MessageBoxA(nullptr, pTmpBuf, v15, 0);
+      MessageBoxA(nullptr, pTmpBuf.data(), v15, 0);
       return;
     }
     v16 = (int)pMovieName;
--- a/Vis.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/Vis.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -619,10 +619,10 @@
     return false;
 
   if (uModelID != -1)
-    ODM_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b,
+    ODM_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a.data(), intersect_face_vertex_coords_list_b.data(),
                                 &IntersectPoint, pFace, uModelID);
   else
-    BLV_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a, intersect_face_vertex_coords_list_b,
+    BLV_CreateIntersectFacesVertexCoordList(&a, &b, intersect_face_vertex_coords_list_a.data(), intersect_face_vertex_coords_list_b.data(),
                                   &IntersectPoint, pFace);
   v5 = 2 * pFace->uNumVertices;
   v16 = 0;
--- a/mm7_1.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/mm7_1.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -383,14 +383,14 @@
   v18 = (signed __int64)__PAIR__(v4, v5) % 60;
   v17 = (signed __int64)__PAIR__(v6, v7) % 60;
   v9 = v8 % 24;
-  strcpy(pTmpBuf, "\r020");
+  strcpy(pTmpBuf.data(), "\r020");
   if ( (unsigned int)v8 / 0x18 )
   {
     v10 = pGlobalTXT_LocalizationStrings[57];   // Days
     if ( v19 <= 1 )
       v10 = pGlobalTXT_LocalizationStrings[56]; // Day
-    sprintfex(pTmpBuf2, "%d %s ", (int)v19, v10);
-    strcat(pTmpBuf, pTmpBuf2);
+    sprintfex(pTmpBuf2.data(), "%d %s ", (int)v19, v10);
+    strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
   if ( v9 )
   {
@@ -398,8 +398,8 @@
       v11 = pGlobalTXT_LocalizationStrings[109];// Hour
     else
       v11 = pGlobalTXT_LocalizationStrings[110];// Hours
-    sprintfex(pTmpBuf2, "%d %s ", (int)v9, v11);
-    strcat(pTmpBuf, pTmpBuf2);
+    sprintfex(pTmpBuf2.data(), "%d %s ", (int)v9, v11);
+    strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
   if ( v17 && !v19 )
   {
@@ -407,8 +407,8 @@
       v12 = pGlobalTXT_LocalizationStrings[437];// Minute
     else
       v12 = pGlobalTXT_LocalizationStrings[436];// Minutes
-    sprintfex(pTmpBuf2, "%d %s ", (int)v17, v12);
-    strcat(pTmpBuf, pTmpBuf2);
+    sprintfex(pTmpBuf2.data(), "%d %s ", (int)v17, v12);
+    strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
   if ( v18 && !v9 )
   {
@@ -416,10 +416,10 @@
       v13 = pGlobalTXT_LocalizationStrings[439];// Second
     else
       v13 = pGlobalTXT_LocalizationStrings[438];// Seconds
-    sprintfex(pTmpBuf2, "%d %s ", (int)v18, v13);
-    strcat(pTmpBuf, pTmpBuf2);
+    sprintfex(pTmpBuf2.data(), "%d %s ", (int)v18, v13);
+    strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
-  a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0);
+  a1->DrawText(a2, 32, uY, 0, pTmpBuf.data(), 0, 0, 0);
 }
 
 //----- (0041F54A) --------------------------------------------------------
@@ -430,8 +430,8 @@
   if ( pTexture_RestUI_CurrentHourglassFrame )
     pTexture_RestUI_CurrentHourglassFrame->Release();
   pIcons_LOD->SyncLoadedFilesCount();
-  sprintf(pTmpBuf, "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour);
-  pTexture_RestUI_CurrentSkyFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
+  sprintf(pTmpBuf.data(), "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour);
+  pTexture_RestUI_CurrentSkyFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
 }
 
 //----- (0041F5BE) --------------------------------------------------------
@@ -532,7 +532,7 @@
   {
     if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 )
     {
-      sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold!
+      sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold!
     }
     else
     {
@@ -601,11 +601,11 @@
       v3 = (signed int)(v4 * v3 / 100) / 100;
       if ( v3 < 1 )
         v3 = 1;
-      sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)!
+      sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)!
     }
     else
     {
-      sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold!
+      sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold!
     }
     v2 = 0;
   }
@@ -613,7 +613,7 @@
   pUIAnim_Gold->uAnimTime = v2;
   pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength;
   if ( pTmpBuf2[0] )
-    ShowStatusBarString(pTmpBuf2, 2u);
+    ShowStatusBarString(pTmpBuf2.data(), 2u);
   pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2);
 }
 
@@ -923,8 +923,8 @@
       }
       else
       {
-        sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v23].pUnidentifiedName);
-        ShowStatusBarString(pTmpBuf2, 2u);
+        sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v23].pUnidentifiedName);
+        ShowStatusBarString(pTmpBuf2.data(), 2u);
         if ( v22->uItemID == 506 )
           _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u);
         if ( v22->uItemID == 455 )
@@ -1084,7 +1084,7 @@
           if ( v20 )
           {
             pParty->uFlags |= 2u;
-            strcpy(byte_5B0938, v20);
+            strcpy(byte_5B0938.data(), v20);
             sub_4451A8_press_any_key(0, 0, 0);
           }
         }
--- a/mm7_2.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/mm7_2.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -880,7 +880,7 @@
         do
         {
           HouseNPCData[v2 + 7] = (NPCData *)window_SpeakInHouse->CreateButton(pNPCPortraits_x[v1 - 1][v2], pNPCPortraits_y[v1 - 1][v2],
-                                              0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v2, 0, byte_591180[v2], 0, 0, 0);
+                                              0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v2, 0, byte_591180[v2].data(), 0, 0, 0);
           v1 = uNumDialogueNPCPortraits;
           ++v2;
           //v3 += 100;
@@ -1085,8 +1085,8 @@
       uPriceItemService = pPlayers[uActiveCharacter]->GetBuyingPrice(bought_item->GetValue(), p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier);
       uNumSeconds = 0;
       a3 = 0;
-      if ( pMapStats->GetMapInfo(pCurrentMapName) )
-        a3 = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)]._steal_perm;
+      if ( pMapStats->GetMapInfo(pCurrentMapName.data()) )
+        a3 = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName.data())]._steal_perm;
       party_reputation = GetPartyReputation();
       if (pPlayers[uActiveCharacter]->CanSteal())
       {
@@ -1285,13 +1285,13 @@
   {
 	v4 = pClassNames[v3->classType];
     v5 = v3->GetBaseLevel();
-	sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[129], i->pName, v5, v4);
+	sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[129], i->pName, v5, v4);
     pWindow.DrawTitleText(
       pFont,
       1u,
       v20 * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46,
       1u,
-      pTmpBuf,
+      pTmpBuf.data(),
       3u);
 	v23 += i->uExperience;//__PAIR__(*(int *)(i - 4), *(int *)(i - 8));
     ++v20;
@@ -1302,7 +1302,7 @@
   v23 = (signed __int64)v23 / v19;
   v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xCu, 0);
   pWindow.DrawTitleText(pFont, 1u, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1u, v6, 0);
-  strcpy(pTmpBuf, pGlobalTXT_LocalizationStrings[37]);
+  strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[37]);
   v7 = pGlobalTXT_LocalizationStrings[56];
   if ( v17 != 1 )
     v7 = pGlobalTXT_LocalizationStrings[57];
@@ -1312,11 +1312,11 @@
   v9 = pGlobalTXT_LocalizationStrings[245];
   if ( v14 != 1 )
     v9 = pGlobalTXT_LocalizationStrings[132];
-  sprintf(pTmpBuf2, " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7);
-  strcat(pTmpBuf, pTmpBuf2);
-  pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf, 3u);
-  sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[94], v23);
-  pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight, 1u, pTmpBuf, 3u);
+  sprintf(pTmpBuf2.data(), " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7);
+  strcat(pTmpBuf.data(), pTmpBuf2.data());
+  pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf.data(), 3u);
+  sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[94], v23);
+  pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight, 1u, pTmpBuf.data(), 3u);
   BYTE1(dword_6BE364_game_settings_1) |= 0x40u;
   pRenderer->EndScene();
   pRenderer->Present();
@@ -5108,7 +5108,7 @@
   char Drive[4]; // [sp+408h] [bp-8h]@1
   int DstBuf; // [sp+40Ch] [bp-4h]@2
 
-  strcpy(a1, pCurrentMapName);
+  strcpy(a1, pCurrentMapName.data());
   _splitpath(a1, Drive, Dir, Filename, Ext);
   sprintf(a1, "levels\\%s%s", Filename, ".lod");
   v0 = fopen(a1, "rb");
@@ -5222,7 +5222,7 @@
   pGameLoadingUI_ProgressBar->Reset(0x1Bu);
   pSoundList->_4A9D79(0);
   uCurrentlyLoadedLevelType = (LEVEL_TYPE)2;
-  ODM_LoadAndInitialize(pCurrentMapName, v3);
+  ODM_LoadAndInitialize(pCurrentMapName.data(), v3);
   if ( !v2 )
     TeleportToStartingPoint(uLevel_StartingPointType);
   viewparams->_443365();
@@ -5264,7 +5264,7 @@
   //v1 = 0;
   dword_5C6DF8 = 1;
   pNPCStats->uNewlNPCBufPos = 0;
-  v19 = pMapStats->GetMapInfo(pCurrentMapName);
+  v19 = pMapStats->GetMapInfo(pCurrentMapName.data());
 
   //v15 = 0;
   for (uint i = 0; i < uNumActors; ++i)
@@ -5491,7 +5491,7 @@
   ofn.lCustData = 0;
   ofn.lpfnHook = 0;
   ofn.lpTemplateName = 0;
-  ofn.lpstrFileTitle = pTmpBuf;
+  ofn.lpstrFileTitle = pTmpBuf.data();
 }
 
 //----- (004627B7) --------------------------------------------------------
@@ -6845,7 +6845,7 @@
 //----- (00464839) --------------------------------------------------------
 char __cdecl Is_out15odm_underwater()
 {
-  return _stricmp(pCurrentMapName, "out15.odm") == 0;
+  return _stricmp(pCurrentMapName.data(), "out15.odm") == 0;
 }
 
 //----- (00464851) --------------------------------------------------------
@@ -6872,12 +6872,12 @@
   ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
   pDecalBuilder->Reset(0);
   pGameLoadingUI_ProgressBar->Initialize((GUIProgressBar::Type)v2);
-  strcpy(Str1, pCurrentMapName);
+  strcpy(Str1, pCurrentMapName.data());
   v3 = strtok(Str1, ".");
   strcpy(Str1, v3);
   Level_LoadEvtAndStr(Str1);
   LoadLevel_InitializeLevelEvt();
-  strcpy(Str1, pCurrentMapName);
+  strcpy(Str1, pCurrentMapName.data());
   _strrev(Str1);
   strtok(Str1, ".");
   _strrev(Str1);
@@ -6885,11 +6885,11 @@
   for (uint i = 0; i < 1000; ++i)
     pSpriteObjects[i].uObjectDescID = 0;
 
-  v5 = pMapStats->GetMapInfo(pCurrentMapName);
+  v5 = pMapStats->GetMapInfo(pCurrentMapName.data());
   bUnderwater = 0;
   uLevelMapStatsID = v5;
   pGame->uFlags2 &= 0xFFFFFFF7u;
-  if ( !_stricmp(pCurrentMapName, "out15.odm") )
+  if ( !_stricmp(pCurrentMapName.data(), "out15.odm") )
   {
     bUnderwater = 1;
     pGame->uFlags2 |= 8u;
@@ -6901,7 +6901,7 @@
     PrepareToLoadBLV(v9);
   pAudioPlayer->SetMapEAX();
   sub_461103();
-  if ( !_stricmp(pCurrentMapName, "d11.blv") || !_stricmp(pCurrentMapName, "d10.blv") )
+  if ( !_stricmp(pCurrentMapName.data(), "d11.blv") || !_stricmp(pCurrentMapName.data(), "d10.blv") )
   {
     //spawning grounds & good analogue - no loot & exp from monsters
 
@@ -7910,8 +7910,8 @@
   for (uint i = 0; i < 5; ++i)
     for (uint j = 0; j < 6; ++j)
     {
-      sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", i, j);
-      remove(pTmpBuf);
+      sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j);
+      remove(pTmpBuf.data());
     }
 
   Initialize_GamesLOD_NewLOD();
@@ -8156,7 +8156,7 @@
           pParty->Reset();
           pOtherOverlayList->Reset();
 
-          strcpy(pCurrentMapName, pStartingMapName);
+          strcpy(pCurrentMapName.data(), pStartingMapName.data());
           pParty->CreateDefaultParty(0);
           PlayerCreationUI_Initialize();
           if ( PlayerCreationUI_Loop() )
@@ -8212,7 +8212,7 @@
             break;
           }
           _chdir("..\\");
-          strcpy(pCurrentMapName, ofn.lpstrFileTitle);
+          strcpy(pCurrentMapName.data(), ofn.lpstrFileTitle);
           pMouse->Activate(1);
         }
 //LABEL_48:
@@ -8306,17 +8306,17 @@
 
   wchar_t pStartingMapNameW[1024];
   GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename);
-  sprintf(pStartingMapName, "%S", pStartingMapNameW);
+  sprintf(pStartingMapName.data(), "%S", pStartingMapNameW);
 
   v9 = 0;
-  if ( strlen(pStartingMapName) )
+  if ( strlen(pStartingMapName.data()) )
   {
     do
     {
       if ( pStartingMapName[v9] == 32 )
         pStartingMapName[v9] = 0;
       ++v9;
-      v2 = strlen(pStartingMapName);
+      v2 = strlen(pStartingMapName.data());
     }
     while ( v9 < v2 );
   }
@@ -8355,7 +8355,7 @@
 
   wchar_t pDefaultSkyTextureW[1024];
   GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename);
-  sprintf(pDefaultSkyTexture, "%S", pDefaultSkyTextureW);
+  sprintf(pDefaultSkyTexture.data(), "%S", pDefaultSkyTextureW);
 
   wchar_t pDefaultGroundTextureW[1024];
   GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename);
@@ -8371,7 +8371,7 @@
   flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667;
 
   v3 = 0;
-  if ( strlen(pDefaultSkyTexture) )
+  if ( strlen(pDefaultSkyTexture.data()) )
   {
     do
     {
@@ -8379,7 +8379,7 @@
         pDefaultSkyTexture[v3] = 0;
       ++v3;
     }
-    while ( v3 < strlen(pDefaultSkyTexture) );
+    while ( v3 < strlen(pDefaultSkyTexture.data()) );
   }
   v4 = 0;
   if ( strlen(pDefaultGroundTexture) )
@@ -8469,11 +8469,11 @@
   va_start(va, Format);
   if ( !pRenderer->bWindowMode )
     pRenderer->ChangeBetweenWinFullscreenModes();
-  vsprintf(pTmpBuf, Format, va);
+  vsprintf(pTmpBuf.data(), Format, va);
   if ( pMouse )
     pMouse->Activate(0);
   ClipCursor(0);
-  MessageBoxA(0, pTmpBuf, "Error", 0x30u);
+  MessageBoxA(0, pTmpBuf.data(), "Error", 0x30u);
   Game_DeinitializeAndTerminate(1);
 }
 
@@ -8651,8 +8651,8 @@
   a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
   v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName;
   v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-  sprintf(pTmpBuf, format_4E2D80, v2, v1);
-  a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
+  sprintf(pTmpBuf.data(), format_4E2D80, v2, v1);
+  a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3u);
   a1.DrawText(
            pFontSmallnum,
            1,
@@ -9324,8 +9324,8 @@
         if ( pParty->pPickedItem.uItemID )
           return 1;
         v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName;
-        sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24);
-        ShowStatusBarString(pTmpBuf2, 2u);
+        sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v24);
+        ShowStatusBarString(pTmpBuf2.data(), 2u);
         if ( v19->uItemID == 506 )
           _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u);
         if ( v19->uItemID == 455 )
@@ -9365,7 +9365,7 @@
               if ( v16 )
               {
                 pParty->uFlags |= 2u;
-                strcpy(byte_5B0938, v16);
+                strcpy(byte_5B0938.data(), v16);
                 sub_4451A8_press_any_key(0, 0, 0);
               }
             }
@@ -9777,7 +9777,7 @@
 LABEL_18:
   if ( !((unsigned __int8)(v11 ^ v12) | v10) )
   {
-    v14 = dword_720020_zvalues;
+    v14 = dword_720020_zvalues.data();
     v15 = 1;
     do
     {
@@ -9922,7 +9922,7 @@
     || pParty->vPosition.y < -22528
     || pParty->vPosition.y > 22528 )
   {
-    strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
+    strcpy(pOutdoor->pLevelFilename, pCurrentMapName.data());
     v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 32);
     if ( !bUnderwater && (pParty->uFlags & (PARTY_FLAGS_1_STANDING_ON_WATER | PARTY_FLAGS_1_FALLING | 0x04) || pParty->uFlags & 0x0200 || pParty->bFlying) || !v0 )
     {
--- a/mm7_3.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/mm7_3.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -5273,7 +5273,7 @@
             }
           }
         }
-        sr_sub_486B4E_push_outdoor_edges(array_508690, dword_50B638, dword_50B570, v12);
+        sr_sub_486B4E_push_outdoor_edges(array_508690, dword_50B638.data(), dword_50B570.data(), v12);
       }
 LABEL_72:
       ++v79;
@@ -6620,7 +6620,7 @@
   GetAlertStatus();
   if ( qword_A750D8 )
     qword_A750D8 = 0i64;
-  v2 = pMapStats->GetMapInfo(pCurrentMapName);
+  v2 = pMapStats->GetMapInfo(pCurrentMapName.data());
   v3 = 0;
   if ( v2 )
   {
@@ -7517,7 +7517,7 @@
       }
       while ( v5 < (signed int)a3->uNumVertices );
     }
-    result = sr_sub_486B4E_push_outdoor_edges(a1, dword_50B638, dword_50B570, a3);
+    result = sr_sub_486B4E_push_outdoor_edges(a1, dword_50B638.data(), dword_50B570.data(), a3);
   }
   return result;
 }
@@ -12937,7 +12937,7 @@
   v16.uRadius = 32;
   v16.uKind = 3;
   v16.uIndex = v8 + 2 * v9 + v9;
-  v10 = pMapStats->GetMapInfo(pCurrentMapName);
+  v10 = pMapStats->GetMapInfo(pCurrentMapName.data());
   if ( v10 )
   {
     v11 = uNumActors;
@@ -13691,11 +13691,11 @@
   v2 = pMapName;
   pAudioPlayer->StopChannels(-1, -1);
   pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_None);
-  if ( _stricmp(pCurrentMapName, v2) )
+  if ( _stricmp(pCurrentMapName.data(), v2) )
     SaveGame(1, 0);
 
   uGameState = GAME_STATE_2;
-  strcpy(pCurrentMapName, v2);
+  strcpy(pCurrentMapName.data(), v2);
   uLevel_StartingPointType = start_point;
 }
 // 6BE35C: using guessed type int uLevel_StartingPointType;
@@ -13903,12 +13903,12 @@
   int i; // eax@1
 
   v2 = uNumSeconds;
-  strcpy(GameUI_Footer_TimedString, pString);
+  strcpy(GameUI_Footer_TimedString.data(), pString);
   GameUI_Footer_TimeLeft = 1000 * v2 + GetTickCount();
-  for ( i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString);
+  for ( i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data());
         i > 450;
-        i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString) )
-    byte_5C3427[strlen(GameUI_Footer_TimedString)] = 0;
+        i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()) )
+    byte_5C3427[strlen(GameUI_Footer_TimedString.data())] = 0;
 }
 
 //----- (0044C1D0) --------------------------------------------------------
@@ -13929,7 +13929,7 @@
 {
   bool result; // eax@1
 
-  result = _stricmp("nwc.blv", pCurrentMapName);
+  result = _stricmp("nwc.blv", pCurrentMapName.data());
   if ( result )
   {
     _5B65A8_npcdata_uflags_or_other = 0;
@@ -14405,8 +14405,8 @@
     v33 = 30;
     ai_arrays_size = 30;
   }
-  memcpy(ai_near_actors_ids, ai_array_4F6638_actor_ids, 4 * v33);
-  memcpy(ai_near_actors_distances, ai_array_4F5E68, 4 * ai_arrays_size);
+  memcpy(ai_near_actors_ids.data(), ai_array_4F6638_actor_ids.data(), 4 * v33);
+  memcpy(ai_near_actors_distances.data(), ai_array_4F5E68.data(), 4 * ai_arrays_size);
   v34 = (unsigned int)ai_arrays_size;
   if ( ai_arrays_size > 0 )
   {
@@ -15389,7 +15389,7 @@
   v40b = v35;
   if ( v40b < v40b + ai_arrays_size )
   {
-    v34 = (int *)ai_near_actors_ids;
+    v34 = (int *)ai_near_actors_ids.data();
     do
     {
       v37 = *v34;
--- a/mm7_4.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/mm7_4.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -795,7 +795,7 @@
   do
   {
     v24 = dword_720F20[v5 / 4];
-    v25 = *(int *)((char *)dword_720F20 + v23);
+    v25 = *(int *)((char *)dword_720F20.data() + v23);
     if ( v24 == v25 )
       goto LABEL_50;
     if ( v25 > a3 + 15 )
@@ -1476,7 +1476,7 @@
   signed int v2; // eax@3
 
   v0 = 0;
-  v1 = ptr_80CA10;
+  v1 = ptr_80CA10.data();
   do
   {
     ++v0;
@@ -2402,7 +2402,7 @@
           v14->ReceiveDamage((signed __int64)v15, DMGT_FIRE);
           if ( pParty->uFlags & 4 )
           {
-            strcpy(GameUI_Footer_TimedString, pGlobalTXT_LocalizationStrings[660]);
+            strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[660]);
             GameUI_Footer_TimeLeft = 128;
           }
           goto LABEL_39;
@@ -2431,7 +2431,7 @@
       v17->ReceiveDamage((signed __int64)v18, DMGT_FIRE);
       if ( pParty->uFlags & 0x200 )
       {
-        strcpy(GameUI_Footer_TimedString, pGlobalTXT_LocalizationStrings[661]);
+        strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[661]);
         GameUI_Footer_TimeLeft = 128;
       }
       ++v16;
@@ -3367,7 +3367,7 @@
   pPlayer = &pParty->pPlayers[v6];
   v59 = TargetColor(255, 255, 155);
   //v61 = pPlayer;
-  memset(pTmpBuf2, 0, sizeof(pTmpBuf2));
+  memset(pTmpBuf2.data(), 0, sizeof(pTmpBuf2));
 
   NPCData *npc = nullptr;
   if ( dword_5C35D4 )
@@ -3537,8 +3537,8 @@
           {
             v11 = pGlobalTXT_LocalizationStrings[393];// "daughter"
 _continue_strcat:
-            strcat(pTmpBuf2, v11);
-            dst = strlen(pTmpBuf2);
+            strcat(pTmpBuf2.data(), v11);
+            dst = strlen(pTmpBuf2.data());
             //v64 += 2;
             i += 2;
           }
@@ -3578,7 +3578,7 @@
 
           case 23:
           {
-            v47 = pMapStats->GetMapInfo(pCurrentMapName);
+            v47 = pMapStats->GetMapInfo(pCurrentMapName.data());
             if ( v47 )
               v11 = pMapStats->pInfos[v47].pName;
             else
@@ -3727,7 +3727,7 @@
         }
       }
   }
-  return pTmpBuf2;
+  return pTmpBuf2.data();
 }
 
 //----- (0049B04D) --------------------------------------------------------
@@ -6058,7 +6058,7 @@
   v1 = *_this - 399;
   v2 = (*_this - 400) % 11 + 1;
   v11 = 4 * (*_this - 400) / 11;
-  sprintf(pTmpBuf, "%s%03d", spellbook_texture_filename_suffices[v11 / 4], v2);
+  sprintf(pTmpBuf.data(), "%s%03d", spellbook_texture_filename_suffices[v11 / 4], v2);
   if ( pMouse->GetCursorPos(&a2)->y <= 320 )
     v3 = pMouse->GetCursorPos(&a2)->y + 30;
   else
@@ -6081,13 +6081,13 @@
     v5 = v13;
   if ( v4 > v5 )
     v5 = v4;
-  sprintf(pTmpBuf2, "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s",
+  sprintf(pTmpBuf2.data(), "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s",
     pSpellStats->pInfos[v1].pDescription, pGlobalTXT_LocalizationStrings[431],        // "Normal"
     v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pBasicSkillDesc, pGlobalTXT_LocalizationStrings[433],        // "Expert"
     v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pExpertSkillDesc, pGlobalTXT_LocalizationStrings[432],        // "Master"
     v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pMasterSkillDesc, pGlobalTXT_LocalizationStrings[96],         // "Grand"
     v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pGrandmasterSkillDesc);
-  v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2, &a1, 0, 0);
+  v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &a1, 0, 0);
   a1.uFrameHeight += v6;
   if ( (signed int)a1.uFrameHeight < 150 )
     a1.uFrameHeight = 150;
@@ -6100,12 +6100,12 @@
   a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
   v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
   a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u);
-  a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0);
+  a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0);
   a1.uFrameZ = a1.uFrameX + 107;
   a1.uFrameWidth = 108;
   a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v11 / 4 + 12], 3u);
-  sprintf(pTmpBuf, "%s\n%d", pGlobalTXT_LocalizationStrings[522], *(&pSpellDatas[0].uNormalLevelMana + 10 * v1));
-  a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3);
+  sprintf(pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[522], *(&pSpellDatas[0].uNormalLevelMana + 10 * v1));
+  a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3);
 }
 
 //----- (004B1784) --------------------------------------------------------
@@ -6130,12 +6130,12 @@
     v4.uFrameX = 483;
     v4.uFrameWidth = 148;
     v4.uFrameZ = 334;
-    sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427], pPlayer->pName, pGlobalTXT_LocalizationStrings[562]);// 
+    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayer->pName, pGlobalTXT_LocalizationStrings[562]);// 
                                                 // "%s is in no condition to %s"
                                                 // "do anything"
     v2 = TargetColor(255, 255, 0x9Bu);
-    v3 = pFontArrus->CalcTextHeight(pTmpBuf, &v4, 0, 0);
-    v4.DrawTitleText(pFontArrus, 0, (212 - v3) / 2 + 101, v2, pTmpBuf, 3u);
+    v3 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v4, 0, 0);
+    v4.DrawTitleText(pFontArrus, 0, (212 - v3) / 2 + 101, v2, pTmpBuf.data(), 3u);
     result = 0;
   }
   return result;
@@ -6359,7 +6359,7 @@
   v11 = 0;
   uDialogueType = 84;
   current_npc_text = (char *)pNPCTopics[667].pText;
-  v0 = _4F0882_evt_VAR_PlayerItemInHands_vals;
+  v0 = _4F0882_evt_VAR_PlayerItemInHands_vals.data();
   while ( 1 )
   {
     if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0) )
@@ -6822,8 +6822,8 @@
       {
         if ( v31 == v14 )
         {
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[634], pClassNames[v10 + 2], pClassNames[v10 + 3]);//Вы должны достичь звания %s или %s для обучения этому уровню навыка.
-          return pTmpBuf;
+          sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[634], pClassNames[v10 + 2], pClassNames[v10 + 3]);//Вы должны достичь звания %s или %s для обучения этому уровню навыка.
+          return pTmpBuf.data();
         }
         v25 = pClassNames[v10 + 2];
       }
@@ -6831,14 +6831,14 @@
       {
         if ( v31 != v14 )
         {
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[632], pClassNames[pClassType]);//Этот уровень навыка не может быть постигнут классом %s.
-          return pTmpBuf;
+          sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[632], pClassNames[pClassType]);//Этот уровень навыка не может быть постигнут классом %s.
+          return pTmpBuf.data();
         }
         v25 = pClassNames[v10 + 3];
       }
     }
-    sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[633], v25);//Вы должны достичь звания %s для обучения этому уровню навыка.
-    return pTmpBuf;
+    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], v25);//Вы должны достичь звания %s для обучения этому уровню навыка.
+    return pTmpBuf.data();
   }
   if ( !pPlayers[uActiveCharacter]->CanAct() )
     return (char *)pNPCTopics[122].pText;
@@ -7074,20 +7074,20 @@
   contract_approved = 1;
   if ( v34 == 2 )
   {
-    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534],//Получить степень ^Pr[%s] в навыке ^Pr[%s] за ^I[%lu] золот^L[ой;ых;ых]
+    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],//Получить степень ^Pr[%s] в навыке ^Pr[%s] за ^I[%lu] золот^L[ой;ых;ых]
               pGlobalTXT_LocalizationStrings[433], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Эксперт
-    return pTmpBuf2;
+    return pTmpBuf2.data();
   }
   if ( v34 == 3 )
   {
-    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534],
+    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],
               pGlobalTXT_LocalizationStrings[432], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Мастер
-    return pTmpBuf2;
+    return pTmpBuf2.data();
   }
   if ( v34 == 4 )
-    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534],
+    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],
               pGlobalTXT_LocalizationStrings[225], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Великий Магистр
-  return pTmpBuf2;
+  return pTmpBuf2.data();
 }
 
 //----- (004B29F2) --------------------------------------------------------
@@ -7199,8 +7199,8 @@
     v2 = pTransitionStrings[uHouse_ExitPic];
     if ( !v2 )
     {
-      sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[411], v0);
-      v2 = pTmpBuf;
+      sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[411], v0);
+      v2 = pTmpBuf.data();
     }
     v3 = v2;
     v4 = pFontCreate->CalcTextHeight(v2, &a1, 0, 0);
@@ -7215,10 +7215,10 @@
   v7 = TargetColor(0x15u, 0x99u, 0xE9u);
   v8 = v6->uProfession;
   if ( v8 )
-    sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v6->pName, aNPCProfessionNames[v8]);
+    sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], v6->pName, aNPCProfessionNames[v8]);
   else
-    strcpy(pTmpBuf, v6->pName);
-  a1.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, v7, pTmpBuf, 3u);
+    strcpy(pTmpBuf.data(), v6->pName);
+  a1.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, v7, pTmpBuf.data(), 3u);
   if ( !dword_591080 )
   {
     if ( !uDialogueType )
@@ -7292,9 +7292,9 @@
           v30 = TargetColor(0xFFu, 0xFFu, 0xFFu);
           v31 = *(int *)v29;
           v32 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-          sprintfex(pTmpBuf, "\f%05d%s\f%05d", v32, v31, v30);
-          sprintfex(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * (unsigned __int8)v29[8]);
-          current_npc_text = pTmpBuf2;
+          sprintfex(pTmpBuf.data(), "\f%05d%s\f%05d", v32, v31, v30);
+          sprintfex(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf, 100 * (unsigned __int8)v29[8]);
+          current_npc_text = pTmpBuf2.data();
           v15 = "";
           goto LABEL_45;
         }
@@ -7335,9 +7335,9 @@
             }
             if ( uDialogueType != 84 )
               goto LABEL_49;
-            sprintf(pTmpBuf, format_4E2D80, v55, pItemsTable->pItems[contract_approved].pUnidentifiedName);
-            sprintf(pTmpBuf2, current_npc_text, pTmpBuf);
-            current_npc_text = pTmpBuf2;
+            sprintf(pTmpBuf.data(), format_4E2D80, v55, pItemsTable->pItems[contract_approved].pUnidentifiedName);
+            sprintf(pTmpBuf2.data(), current_npc_text, pTmpBuf);
+            current_npc_text = pTmpBuf2.data();
             goto LABEL_45;
           }
           v21 = v20 - 1;
@@ -7803,11 +7803,11 @@
   {
     pDialogueWindow->Release();
     pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
-    sprintfex(sHouseName, pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName);
+    sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName);
     pBtn_ExitCancel = pDialogueWindow->CreateButton(566, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 'N', pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);// "Cancel"
-    pBtn_YES        = pDialogueWindow->CreateButton(486, 445, 75, 33, 1, 0, UIMSG_BF,     1, 'Y', sHouseName, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0);
-    pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0,  UIMSG_BF, 1u, 0x20u,  sHouseName, 0);
-    pDialogueWindow->CreateButton(8, 8, 460, 344, 1, 0, UIMSG_BF, 1, 0x59u, sHouseName, 0);
+    pBtn_YES        = pDialogueWindow->CreateButton(486, 445, 75, 33, 1, 0, UIMSG_BF,     1, 'Y', sHouseName.data(), pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0);
+    pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0,  UIMSG_BF, 1u, 0x20u,  sHouseName.data(), 0);
+    pDialogueWindow->CreateButton(8, 8, 460, 344, 1, 0, UIMSG_BF, 1, 0x59u, sHouseName.data(), 0);
   }
   else
   {
@@ -8388,16 +8388,16 @@
   if ( !v34 )
   {
 LABEL_40:
-    sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
-    strcat(pTmpBuf, "\n \n");
-    strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
+    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
+    strcat(pTmpBuf.data(), "\n \n");
+    strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
     v22 = v31;
-    v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v28, 0, 0);
-    v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
+    v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v28, 0, 0);
+    v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
     return; 
   }
-  sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v32);
-  v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
+  sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v32);
+  v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
   v32 = (149 - v33) / v34;
   if ( (149 - v33) / v34 > 32 )
     v32 = 32;
--- a/mm7_5.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/mm7_5.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -613,9 +613,9 @@
           pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xDu, 0, "", 0);
           uGameMenuUI_CurentlySelectedKeyIdx = -1;
           KeyboardPageNum = 1;
-          memset(GameMenuUI_InvaligKeyBindingsFlags, 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags));
+          memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags));
           //*(_WORD *)KeyButtonArray[28] = 0;
-          memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
+          memcpy(pPrevVirtualCidesMapping.data(), pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
           //v1 = "";
           //v0 = 1;
           continue;
@@ -1365,7 +1365,7 @@
                       viewparams->bRedrawGameUI = true;
                       continue;
                     case SCREEN_BRANCHLESS_NPC_DIALOG://click escape
-                      memset(GameUI_Footer_TimedString, 0, 0xC8u);
+                      memset(GameUI_Footer_TimedString.data(), 0, 0xC8u);
                       sub_4452BB();
                       DialogueEnding();
                       pCurrentScreen = SCREEN_GAME;
@@ -1644,7 +1644,7 @@
           {
             EventProcessor(dword_5C3418, 0, 1, dword_5C341C);
           }
-          if ( !_stricmp(byte_6BE3B0, "d05.blv") )
+          if ( !_stricmp(byte_6BE3B0.data(), "d05.blv") )
             pParty->uTimePlayed += 1474560i64;
           continue;
         case UIMSG_TransitionWindowCloseBtn:
@@ -1664,7 +1664,7 @@
           dword_50CDC8 = 1;
           sub_42FBDD();
           pNPCData4 = (NPCData *)GetTravelTime();
-          strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
+          strcpy(pOutdoor->pLevelFilename, pCurrentMapName.data());
           if ( bUnderwater != 1 && pParty->bFlying
             || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 )
           {
@@ -1722,14 +1722,14 @@
             }
             pPaletteManager->ResetNonLocked();
             pSpriteFrameTable->ResetSomeSpriteFlags();
-            strcpy(pCurrentMapName, pOut);
-            strcpy(pLevelName, pCurrentMapName);
+            strcpy(pCurrentMapName.data(), pOut);
+            strcpy(pLevelName, pCurrentMapName.data());
             v41 = strtok(pLevelName, ".");
             strcpy(pLevelName, v41);
             Level_LoadEvtAndStr(pLevelName);
             pDecalBuilder->Reset(0);
             LoadLevel_InitializeLevelEvt();
-            uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName);
+            uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName.data());
             bUnderwater = 0;
             bNoNPCHiring = 0;
             pGame->uFlags2 &= 0xFFFFFFF7u;
@@ -1738,7 +1738,7 @@
               bUnderwater = 1;
               pGame->uFlags2 |= 8u;
             }
-            if ( !_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d47.blv") )
+            if ( !_stricmp(pCurrentMapName.data(), "out15.odm") || !_stricmp(pCurrentMapName.data(), "d47.blv") )
               bNoNPCHiring = 1;
             PrepareToLoadODM(1u, (OutdoorCamera *)1);
             pAudioPlayer->SetMapEAX();
@@ -1911,7 +1911,7 @@
           dword_50CDC8 = 1;
           sub_42FBDD();
           SaveGame(1, 0);
-          strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename);
+          strcpy(pCurrentMapName.data(), pMapStats->pInfos[uHouse_ExitPic].pFilename);
           dword_6BE364_game_settings_1 |= 1;
           uGameState = GAME_STATE_2;
           //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C];
@@ -1967,24 +1967,24 @@
             if ( !*((int *)&pSavegameThumbnails->pPixels + 10 * uMessageParam) )
               continue;
             v173 = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(pPlayer->pInstalledBeacons[uMessageParam].field_18))].pName;
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s"
-            GameUI_SetFooterString(pTmpBuf);
+            sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s"
+            GameUI_SetFooterString(pTmpBuf.data());
             continue;
           }
-          v59 = pMapStats->GetMapInfo(pCurrentMapName);
+          v59 = pMapStats->GetMapInfo(pCurrentMapName.data());
           thise = "Not in Map Stats";
           if ( v59 )
             thise = pMapStats->pInfos[v59].pName;
           if ( !*((int *)&pSavegameThumbnails->pPixels + 10 * uMessageParam) || !v59 )
           {
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[476], thise);// "Set to %s"
-            GameUI_SetFooterString(pTmpBuf);
+            sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], thise);// "Set to %s"
+            GameUI_SetFooterString(pTmpBuf.data());
             continue;
           }
           v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName;
           v158 = (unsigned int)thise;
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s"
-          GameUI_SetFooterString(pTmpBuf);
+          sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s"
+          GameUI_SetFooterString(pTmpBuf.data());
           continue;
         case UIMSG_CloseAfterInstallBeacon:
           dword_50CDC8 = 1;
@@ -2017,11 +2017,11 @@
           pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[dword_506338], 0, 0, -1, 0, dword_50633C, 0, 0);
           if ( bRecallingBeacon )
           {
-            if ( _stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]) )
+            if ( _stricmp(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]) )
             {
               SaveGame(1, 0);
               OnMapLeave();
-              strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]);
+              strcpy(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]);
               dword_6BE364_game_settings_1 |= 1;
               uGameState = GAME_STATE_2;
               _5B65A8_npcdata_uflags_or_other = pNPCData4->uFlags;
@@ -2073,7 +2073,7 @@
             if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 )
               continue;
             uAction = 0;
-            while ( _stricmp((const char *)pGames_LOD->pSubIndices + uAction, pCurrentMapName) )
+            while ( _stricmp((const char *)pGames_LOD->pSubIndices + uAction, pCurrentMapName.data()) )
             {
               ++thisg;
               uAction += 32;
@@ -2105,7 +2105,7 @@
                 {
 LABEL_486:
                   SaveGame(1, 0);
-                  v64 = pMapStats->GetMapInfo(pCurrentMapName);
+                  v64 = pMapStats->GetMapInfo(pCurrentMapName.data());
                   v65 = uMessageParam;
                   if ( v64 == TownPortalList[uMessageParam].uMapInfoID )
                   {
@@ -2122,7 +2122,7 @@
                     OnMapLeave();
                     dword_6BE364_game_settings_1 |= 1;
                     uGameState = GAME_STATE_2;
-                    strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename);
+                    strcpy(pCurrentMapName.data(), pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename);
                     dword_5B65C0 = 1;
                     _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x;
                     _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y;
@@ -2198,8 +2198,8 @@
                     default:
                     if ( uMessageParam != 5 )
                     {
-                      sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v200);
-                      GameUI_SetFooterString(pTmpBuf);
+                      sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
+                      GameUI_SetFooterString(pTmpBuf.data());
                       continue;
                     }
                     v69 = pMapStats->pInfos[8].pName;
@@ -2210,8 +2210,8 @@
                 {
                   v69 = pMapStats->pInfos[21].pName;
                 }
-                sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v69);
-                GameUI_SetFooterString(pTmpBuf);
+                sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
+                GameUI_SetFooterString(pTmpBuf.data());
                 continue;
               }
               v68 = 210;
@@ -2248,8 +2248,8 @@
                 if ( uMessageParam != 5 )
                   //goto LABEL_519;
                   {
-                    sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v200);
-                    GameUI_SetFooterString(pTmpBuf);
+                    sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
+                    GameUI_SetFooterString(pTmpBuf.data());
                     continue;
                   }
                 v69 = pMapStats->pInfos[8].pName;
@@ -2260,14 +2260,14 @@
           {
             v69 = pMapStats->pInfos[21].pName;
           }
-          sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v69);
-          GameUI_SetFooterString(pTmpBuf);
+          sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
+          GameUI_SetFooterString(pTmpBuf.data());
           continue;
         case UIMSG_ShowFinalWindow:
-          sprintf(pFinalMessage, "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer."
+          sprintf(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer."
             pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment."
             pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team."   
-          ModalWindow(pFinalMessage, 196);
+          ModalWindow(pFinalMessage.data(), 196);
           uGameState = GAME_STATE_FINAL_WINDOW;
           continue;
         case UIMSG_C4:
@@ -2276,7 +2276,7 @@
           strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
         case UIMSG_DD:
 			__debugbreak();
-          sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer);
+          sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer);
           memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216));
           if ( v216.uPropCount == 1 )
           {
@@ -2300,7 +2300,7 @@
               while ( (signed int)pNPCData3 < (signed int)pNPCData4 );
               if ( (signed int)pNPCData3 < (signed int)pNPCData4 )
               {
-                strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]);
+                strcpy(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]);
                 dword_6BE364_game_settings_1 |= 1u;
                 uGameState = GAME_STATE_2;
                 OnMapLeave();
@@ -2555,7 +2555,7 @@
             pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed;
             pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed;
             pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed;
-            v90 = pMapStats->GetMapInfo(pCurrentMapName);
+            v90 = pMapStats->GetMapInfo(pCurrentMapName.data());
             if ( !v90 )
               v90 = rand() % (signed int)pMapStats->uNumMaps + 1;
             pMapInfo = &pMapStats->pInfos[v90];
@@ -2620,7 +2620,7 @@
           if ( quick_spell_at_page && byte_506550 )
           {
             v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName;
-            sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[483], v173);
+            sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173);
           }
           else
           {
@@ -2628,9 +2628,9 @@
               v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell"
             else
               v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell"
-            strcpy(pTmpBuf, v177);
-          }
-          GameUI_SetFooterString(pTmpBuf);
+            strcpy(pTmpBuf.data(), v177);
+          }
+          GameUI_SetFooterString(pTmpBuf.data());
           continue;
         case UIMSG_SPellbook_ShowHightlightedSpellInfo:
           if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter],
@@ -2649,8 +2649,8 @@
             v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
             v161 = pGlobalTXT_LocalizationStrings[486];
           }
-          sprintfex(pTmpBuf, v161, v178);
-          GameUI_SetFooterString(pTmpBuf);
+          sprintfex(pTmpBuf.data(), v161, v178);
+          GameUI_SetFooterString(pTmpBuf.data());
           continue;
         case UIMSG_ClickInstallRemoveQuickSpellBtn:
           GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0);
@@ -3017,8 +3017,8 @@
         case UIMSG_ShowStatus_Funds:
           v174 = (char *)pParty->uNumGoldInBank;
           v158 = pParty->uNumGold + pParty->uNumGoldInBank;
-          sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[489], v158, v174);// "You have %d total gold, %d in the Bank"
-          GameUI_SetFooterString(pTmpBuf);
+          sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], v158, v174);// "You have %d total gold, %d in the Bank"
+          GameUI_SetFooterString(pTmpBuf.data());
           continue;
         case UIMSG_ShowStatus_DateTime:
           pNPCData4 = (NPCData *)pParty->uCurrentHour;
@@ -3033,30 +3033,30 @@
           }
           if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) )
             uNumSeconds = 0;
-          sprintf(pTmpBuf, "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7],
+          sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7],
             7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear);
-          GameUI_SetFooterString(pTmpBuf);
+          GameUI_SetFooterString(pTmpBuf.data());
           continue;
         case UIMSG_ShowStatus_Food:
-          sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food"
-          GameUI_SetFooterString(pTmpBuf);
+          sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food"
+          GameUI_SetFooterString(pTmpBuf.data());
           continue;
         case UIMSG_ShowStatus_Player:
           pPlayer5 = pPlayers[uMessageParam];
-          sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s"
-          strcat(pTmpBuf, ": ");
+          sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s"
+          strcat(pTmpBuf.data(), ": ");
           v107 = pPlayer5->GetMajorConditionIdx();
-          strcat(pTmpBuf, aCharacterConditionNames[v107]);
-          GameUI_SetFooterString(pTmpBuf);
+          strcat(pTmpBuf.data(), aCharacterConditionNames[v107]);
+          GameUI_SetFooterString(pTmpBuf.data());
           v108 = 8 * uMessageParam - 8;
           LOBYTE(v108) = v108 | 4;
           pMouse->uPointingObjectID = PID(OBJECT_Player,v108);
           continue;
         case UIMSG_ShowStatus_ManaHP:
-          sprintf(pTmpBuf, "%d / %d %s    %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(), 
+          sprintf(pTmpBuf.data(), "%d / %d %s    %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(), 
                   pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(), 
                   pGlobalTXT_LocalizationStrings[212]);
-          GameUI_SetFooterString(pTmpBuf);
+          GameUI_SetFooterString(pTmpBuf.data());
           continue;
         case UIMSG_CHEST_ClickItem:
           if ( pCurrentScreen == SCREEN_CHEST_INVENTORY )
@@ -4686,8 +4686,8 @@
         v47 = pGlobalTXT_LocalizationStrings[189];// "%s shoots %s for %lu points"
       else
         v47 = pGlobalTXT_LocalizationStrings[164];// "%s hits %s for %lu damage"
-      sprintfex(pTmpBuf, v47, pPlayerName, pMonsterName, v50);
-      ShowStatusBarString(pTmpBuf, 2u);
+      sprintfex(pTmpBuf.data(), v47, pPlayerName, pMonsterName, v50);
+      ShowStatusBarString(pTmpBuf.data(), 2u);
     }
     v41 = 0;
   }
@@ -4735,8 +4735,8 @@
       v50 = (int)pMonster;
       pMonsterName = (char *)uDamageAmount;
       pPlayerName = player->pName;             // "%s inflicts %lu points killing %s"
-      sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[175], player->pName, uDamageAmount, pMonster);
-      ShowStatusBarString(pTmpBuf, 2u);
+      sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[175], player->pName, uDamageAmount, pMonster);
+      ShowStatusBarString(pTmpBuf.data(), 2u);
     }
   }
   if ( SHIDWORD(pMonster->pActorBuffs[20].uExpireTime) >= (signed int)v41
@@ -4758,8 +4758,8 @@
     {
       v50 = (int)pMonster;
       pMonsterName = player->pName;            // "%s stuns %s"
-      sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[635], player->pName, pMonster);
-      ShowStatusBarString(pTmpBuf, 2u);
+      sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[635], player->pName, pMonster);
+      ShowStatusBarString(pTmpBuf.data(), 2u);
     }
   }
   if ( hit_will_paralyze != v41 )
@@ -4778,8 +4778,8 @@
         {
           v50 = (int)pMonster;
           pMonsterName = player->pName;        // "%s paralyzes %s"
-          sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[636], player->pName, pMonster);
-          ShowStatusBarString(pTmpBuf, 2u);
+          sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[636], player->pName, pMonster);
+          ShowStatusBarString(pTmpBuf.data(), 2u);
         }
       }
     }
@@ -5099,8 +5099,8 @@
       v52 = v51;
       if ( (signed int)SkillToMastery(v51) >= 4 && rand() % 100 < (v52 & 0x3F) )
       {
-		  sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[637], v45->pName);
-        ShowStatusBarString(pTmpBuf, 2u);
+		  sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[637], v45->pName);
+        ShowStatusBarString(pTmpBuf.data(), 2u);
         v45->PlaySound(SPEECH_6, 0);
         return;
       }
@@ -8786,9 +8786,9 @@
   v6 = 0;
   v7 = 0;
   v5 = 0;
-  if ( !_stricmp(pCurrentMapName, "d25.blv") )
+  if ( !_stricmp(pCurrentMapName.data(), "d25.blv") )
     v8 = 1;
-  if ( !_stricmp(pCurrentMapName, "d26.blv") )
+  if ( !_stricmp(pCurrentMapName.data(), "d26.blv") )
     v6 = 1;
   if (_449B57_test_bit(pParty->_quest_bits, 99))
     v7 = 1;
@@ -9227,8 +9227,8 @@
   pWindow.uFrameW = game_viewport_w;
   if ( !bRecallingBeacon )
     v1 = pGlobalTXT_LocalizationStrings[375];   // Set Beacon
-  sprintf(pTmpBuf, "%s", v1);
-  pWindow.DrawTitleText(pBook2Font, 0, 22u, 0, pTmpBuf, 3u);
+  sprintf(pTmpBuf.data(), "%s", v1);
+  pWindow.DrawTitleText(pBook2Font, 0, 22u, 0, pTmpBuf.data(), 3u);
   if ( bRecallingBeacon )
   {
     pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6b__zoom_on);
@@ -9302,9 +9302,9 @@
       v13 = pGlobalTXT_LocalizationStrings[57]; // Days
       if ( v11 > 1 )
       {
-        sprintf(pTmpBuf, "%lu %s", v11 + 1, v13);
+        sprintf(pTmpBuf.data(), "%lu %s", v11 + 1, v13);
         pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
-        pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf, 3);
+        pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
         goto LABEL_29;
       }
     }
@@ -9316,16 +9316,16 @@
           v12 = pGlobalTXT_LocalizationStrings[109];// Hour
         else
           v12 = pGlobalTXT_LocalizationStrings[110];// Hours
-        sprintf(pTmpBuf, "%lu %s", v10 + 1, v12);
+        sprintf(pTmpBuf.data(), "%lu %s", v10 + 1, v12);
         pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
-        pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf, 3);
+        pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
         goto LABEL_29;
       }
     }
     v13 = pGlobalTXT_LocalizationStrings[56];   // Day
-    sprintf(pTmpBuf, "%lu %s", v11 + 1, v13);
+    sprintf(pTmpBuf.data(), "%lu %s", v11 + 1, v13);
     pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
-    pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf, 3);
+    pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
     goto LABEL_29;
   }
 LABEL_30:
@@ -9421,8 +9421,8 @@
 {
   GUIWindow v0; // [sp+4h] [bp-54h]@1
 
-  sprintf(pTmpBuf2, "%s\n \n%s", ptr_507BDC->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape
-  v0.Hint = pTmpBuf2;
+  sprintf(pTmpBuf2.data(), "%s\n \n%s", ptr_507BDC->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape
+  v0.Hint = pTmpBuf2.data();
   v0.uFrameWidth = 400;
   v0.uFrameHeight = 100;
   v0.uFrameX = 120;
@@ -9985,8 +9985,8 @@
   }
   if ( !v0->CanAct() )
   {
-    sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427], v0->pName, pGlobalTXT_LocalizationStrings[541]);
-    v43.Hint = pTmpBuf;
+    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], v0->pName, pGlobalTXT_LocalizationStrings[541]);
+    v43.Hint = pTmpBuf.data();
     v43.uFrameWidth = 384;
     v43.uFrameHeight = 180;
     v43.uFrameY = 40;
@@ -10594,8 +10594,8 @@
   Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
   Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
   v4 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-  sprintf(pTmpBuf, format_4E2D80, v4, v3);
-  Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
+  sprintf(pTmpBuf.data(), format_4E2D80, v4, v3);
+  Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3u);
   Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v2, 0, 0, 0);
 }
 
--- a/mm7_6.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/mm7_6.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -1279,10 +1279,10 @@
     Dst.uItemID = pActor->uCarriedItemID;
     v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
     if ( v14 )
-      sprintfex(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9);
+      sprintfex(pTmpBuf2.data(), (char*)pGlobalTXT_LocalizationStrings[490], v14, v9);
     else
-      sprintfex(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9);
-    ShowStatusBarString(pTmpBuf2, 2u);
+      sprintfex(pTmpBuf2.data(), (char*)pGlobalTXT_LocalizationStrings[471], v9);
+    ShowStatusBarString(pTmpBuf2.data(), 2u);
     v4 = Dst.uItemID;
     v5 = Dst.uItemID;
     if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 )
@@ -1329,10 +1329,10 @@
       pActor->array_000234[3].Reset();
       v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
       if ( v14 )
-        sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11);
+        sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v11);
       else
-        sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11);
-      ShowStatusBarString(pTmpBuf2, 2u);
+        sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v11);
+      ShowStatusBarString(pTmpBuf2.data(), 2u);
       if ( !pParty->AddItem(&Dst) )
         pParty->SetHoldingItem(&Dst);
       v13 = 1;
@@ -1348,10 +1348,10 @@
   pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst);
   v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
   if ( v14 )
-    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10);
+    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10);
   else
-    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10);
-  ShowStatusBarString(pTmpBuf2, 2u);
+    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10);
+  ShowStatusBarString(pTmpBuf2.data(), 2u);
   v8 = pParty;
   if ( !pParty->AddItem(&Dst) )
     pParty->SetHoldingItem(&Dst);
@@ -3793,7 +3793,7 @@
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096);
+			auto _v726 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096);
 			v700.z = 0;
 			v700.y = 0;
 			v700.x = 0;
@@ -4498,7 +4498,7 @@
 		case SPELL_WATER_LLOYDS_BEACON:
 		{
 			LODWORD(v733) = 604800 * v2;
-			if ( !_stricmp(pCurrentMapName, "d05.blv") )
+			if ( !_stricmp(pCurrentMapName.data(), "d05.blv") )
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
@@ -4765,7 +4765,7 @@
 				LODWORD(v733) = 300 * v2 + 180;
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096);
+			auto _v726 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096);
 			pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u);
 			++pSpellSprite.uType;
 			pSpellSprite.stru_24.Reset();
@@ -5070,13 +5070,13 @@
 				if (v683.uItemID)
 				{
 					v422 = v683.GetDisplayName();
-					sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675);
+					sprintf(pTmpBuf2.data(), "(%s), and %d gold", v422, v675);
 
 				}
 				else
 				{
 					v664 = "%d gold";
-					sprintf(pTmpBuf2, v664, v675);
+					sprintf(pTmpBuf2.data(), v664, v675);
 				}
 			}
 			else
@@ -5085,15 +5085,15 @@
 				{
 					const char *_v675 = v683.GetDisplayName();
 					v664 = "(%s)";
-					sprintf(pTmpBuf2, v664, _v675);
+					sprintf(pTmpBuf2.data(), v664, _v675);
 				}
 				else
 				{
-					strcpy(pTmpBuf2, "nothing");
-					ShowStatusBarString(pTmpBuf2, 2u);
+					strcpy(pTmpBuf2.data(), "nothing");
+					ShowStatusBarString(pTmpBuf2.data(), 2u);
 				}
 			}
-			ShowStatusBarString(pTmpBuf2, 2u);
+			ShowStatusBarString(pTmpBuf2.data(), 2u);
 			pSpellSprite.stru_24.Reset();
 			pSpellSprite.spell_id = pCastSpell->spellnum;
 			pSpellSprite.spell_level = v2;
@@ -5235,7 +5235,7 @@
 				amount = 180 * v2;
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096);
+			auto _v726 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096);
 			pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u);
 			++pSpellSprite.uType;
 			pSpellSprite.stru_24.Reset();
@@ -5328,8 +5328,8 @@
 				}
 				else
 				{
-					sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName);
-					ShowStatusBarString(pTmpBuf2, 2u);
+					sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName);
+					ShowStatusBarString(pTmpBuf2.data(), 2u);
 					if ( !pParty->AddItem(&pSpriteObjects[v445].stru_24) )
 						pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24);
 				}
@@ -5629,7 +5629,7 @@
 				break;
 
 			pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u);
-			v505 = sub_46A6AC((int)dword_50BF30, 100, 4096);
+			v505 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096);
 			++pSpellSprite.uType;
 			//signed int _v733 = v505;
 			v688.x = 0;
@@ -5749,7 +5749,7 @@
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			v531 = sub_46A6AC((int)dword_50BF30, 100, 4096);
+			v531 = sub_46A6AC((int)dword_50BF30.data(), 100, 4096);
 			++pSpellSprite.uType;
 			v694.x = 0;
 			v694.y = 0;
@@ -6286,7 +6286,7 @@
 				break;
 			pGame->GetIndoorCamera();
 			v623 = (signed __int64)pGame->pIndoorCameraD3D->GetPickDepth();
-			signed int _v733 = sub_46A6AC((int)dword_50BF30, 100, v623);
+			signed int _v733 = sub_46A6AC((int)dword_50BF30.data(), 100, v623);
 			v707.x = 0;
 			v707.y = 0;
 			v707.z = 0;
@@ -6929,7 +6929,7 @@
       if ( v4 > 0 )
       {
         v32 = 1;
-        v16 = (int)dword_50BC10;
+        v16 = (int)dword_50BC10.data();
         do
         {
           for ( i = v32; i < v4; ++i )
@@ -6952,7 +6952,7 @@
           v19 = v4;
           do
           {
-            *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF;
+            *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10.data() - (char *)v24].field_0 >> 3) & 0x1FFF;
             v18 += 4;
             --v19;
           }
@@ -6992,7 +6992,7 @@
   uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart");
   uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1");
   uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11");
-  v1 = pIconIDs_Turn;
+  v1 = pIconIDs_Turn.data();
   do
   {
     pIconsFrameTable->InitializeAnimation(*v1);
--- a/mm7_data.cpp	Sat Jun 08 21:47:29 2013 +0200
+++ b/mm7_data.cpp	Sun Jun 09 00:30:48 2013 +0200
@@ -345,10 +345,10 @@
 
 
 
-unsigned int saveload_dlg_xs[2] = {82, 0};
-unsigned int saveload_dlg_ys[2] = {60, 0};
-unsigned int saveload_dlg_zs[2] = {460, 640};
-unsigned int saveload_dlg_ws[2] = {344, 480};
+std::array<unsigned int, 2> saveload_dlg_xs = {82, 0};
+std::array<unsigned int, 2> saveload_dlg_ys = {60, 0};
+std::array<unsigned int, 2> saveload_dlg_zs = {460, 640};
+std::array<unsigned int, 2> saveload_dlg_ws = {344, 480};
 int pWindowList_at_506F50_minus1_indexing[1];
 int dword_4C9890[10]; // weak
 int dword_4C9920[16]; // weak
@@ -360,7 +360,7 @@
 int (__stdcall *off_4DAFDC)(char); // weak
 char asc_4DB724[777]; // idb
 int dword_4DBD94; // weak
-int dword_4DF380[5]={0,1024,2560,5120,10240}; // weak
+std::array<int, 5> dword_4DF380 = {{0,1024,2560,5120,10240}}; // weak
 //int dword_4DF390; // weak
 char Str2[777]; // idb
 
@@ -385,19 +385,19 @@
 char aIcons[777]; // idb
 char aPending[777]; // idb
 char aCanTFindS[777]; // idb
-char *spellbook_texture_filename_suffices[9] = {"f", "a", "w", "e", "s", "m", "b", "l", "d"}; // weak
+std::array<char *, 9> spellbook_texture_filename_suffices = {{"f", "a", "w", "e", "s", "m", "b", "l", "d"}}; // weak
 //__int16 word_4E1D3A[777]; // weak
-__int16 pTownPortalBook_xs[6] = {260, 324, 147, 385, 390,  19};
-__int16 pTownPortalBook_ys[6] = {206,  84, 182, 239,  17, 283};
-__int16 pTownPortalBook_ws[6] = { 80,  66,  68,  72,  67,  74};
-__int16 pTownPortalBook_hs[6] = { 55,  56,  65,  67,  67,  59};
+std::array<__int16, 6> pTownPortalBook_xs = {{260, 324, 147, 385, 390,  19}};
+std::array<__int16, 6> pTownPortalBook_ys = {{206,  84, 182, 239,  17, 283}};
+std::array<__int16, 6> pTownPortalBook_ws = {{ 80,  66,  68,  72,  67,  74}};
+std::array<__int16, 6> pTownPortalBook_hs = {{ 55,  56,  65,  67,  67,  59}};
 
 
-unsigned int pLloydsBeaconsPreviewXs[5] = {61, 281,  61, 281, 171}; // 004E249C
-unsigned int pLloydsBeaconsPreviewYs[5] = {84,  84, 228, 228, 155};
-unsigned int pLloydsBeacons_SomeXs[5] = {59, 279, 59, 279, 169};
-unsigned int pLloydsBeacons_SomeYs[5] = {82, 82, 226, 226, 153};
-char aSbwb00[7]; // weak
+std::array<unsigned int, 5> pLloydsBeaconsPreviewXs = {{61, 281,  61, 281, 171}}; // 004E249C
+std::array<unsigned int, 5> pLloydsBeaconsPreviewYs = {{84,  84, 228, 228, 155}};
+std::array<unsigned int, 5> pLloydsBeacons_SomeXs = {{59, 279, 59, 279, 169}};
+std::array<unsigned int, 5> pLloydsBeacons_SomeYs = {{82, 82, 226, 226, 153}};
+std::array<char, 7> aSbwb00; // weak
 char aW[2]; // idb
 char aA[2]; // idb
 char aSD[777]; // idb
@@ -476,19 +476,19 @@
 char aS100110D02dSS[777]; // idb
 int pCurrentScreen = SCREEN_VIDEO; // 004E28F8
 unsigned int uGammaPos;
-int BtnTurnCoord[8] = 
-{
+std::array<int, 8> BtnTurnCoord = 
+{{
   0xA4, 0x5D, 0x16, 0xB, 0x5, 0xD, 0x7, 0x3B,
-}; // weak
-__int16 RightClickPortraitXmin[4]={0x14, 0x83, 0xF2, 0x165};
-__int16 RightClickPortraitXmax[4]={0x53, 0xC6, 0x138, 0x1A7};
+}}; // weak
+std::array<__int16, 4> RightClickPortraitXmin={{0x14, 0x83, 0xF2, 0x165}};
+std::array<__int16, 4> RightClickPortraitXmax={{0x53, 0xC6, 0x138, 0x1A7}};
 void *off_4E2A12; // stat_string_control_button_count
 
-unsigned int pHealthBarPos[4] = {22, 137, 251, 366};
-unsigned int pManaBarPos[4] = {102, 217, 331, 447};
-char _4E2B21_buff_spell_tooltip_colors[80];
-unsigned char monster_popup_y_offsets[88] =
-{
+std::array<unsigned int, 4> pHealthBarPos = {{22, 137, 251, 366}};
+std::array<unsigned int, 4> pManaBarPos = {{102, 217, 331, 447}};
+std::array<char, 80> _4E2B21_buff_spell_tooltip_colors;
+std::array<unsigned char, 88> monster_popup_y_offsets =
+{{
   236,  20,   0, 216,   0,   0,   0,   0,   0,   0, 206,
    20,   0, 246, 246, 236,  10, 246,   0,   0,   0, 236,
    10, 246,   0,   0,   0, 236, 246,   0,   0,   0, 216,
@@ -497,7 +497,7 @@
    20,  10,  10,  10,  10,  10,  10, 166, 196, 216, 236,
   236, 176, 246,   0,   0, 216,   0,   0,   0, 236,  10,
     0,   0,   0,   0,   0,   0, 196,   0,   0,   0,   0
-};
+}};
 unsigned char hourglass_icon_idx = 12; // weak
 
 
@@ -508,53 +508,53 @@
 const char *format_4E2E10 = "%s\f%05u\t110%d\f00000 / %d\n";
 __int16 word_4E3C66[777]; // idb
 int dword_4E455C; // weak
-int dword_4E4560[6];
-int dword_4E4578[6];
-int dword_4E4590[6];
-int dword_4E45A8[6];
+std::array<int, 6> dword_4E4560;
+std::array<int, 6> dword_4E4578;
+std::array<int, 6> dword_4E4590;
+std::array<int, 6> dword_4E45A8;
 _UNKNOWN dword_4E49D4; // idb
 int dword_4E4A18[777]; // weak
 int dword_4E4A1C[777]; // weak
 int dword_4E4A40[777]; // weak
 int dword_4E4A44[777]; // weak
-float flt_4E4A80[10];
+std::array<float, 10> flt_4E4A80;
 
 
-int pPartySpellbuffsUI_XYs[14][2] =
-{
+std::array< std::array<int, 2>, 14> pPartySpellbuffsUI_XYs =
+{{
   {477, 247}, {497, 247}, {522, 247}, {542, 247}, {564, 247}, {581, 247}, {614, 247},
   {477, 279}, {497, 279}, {522, 279}, {542, 279}, {564, 279}, {589, 279}, {612, 279}
-};
-unsigned char byte_4E5DD8[14] =
-{
+}};
+std::array<unsigned char, 14> byte_4E5DD8 =
+{{
   PARTY_BUFF_FEATHER_FALL, PARTY_BUFF_RESIST_FIRE, PARTY_BUFF_RESIST_AIR, PARTY_BUFF_RESIST_WATER, PARTY_BUFF_RESIST_MIND,           PARTY_BUFF_RESIST_EARTH, PARTY_BUFF_RESIST_BODY,
   PARTY_BUFF_HEROISM,      PARTY_BUFF_HASTE,       PARTY_BUFF_SHIELD,     PARTY_BUFF_STONE_SKIN,   PARTY_BUFF_PROTECTION_FROM_MAGIC, PARTY_BUFF_IMMOLATION,   PARTY_BUFF_DAY_OF_GODS
-};
-unsigned __int8 pPartySpellbuffsUI_smthns[14] =
-{
+}};
+std::array<unsigned __int8, 14> pPartySpellbuffsUI_smthns =
+{{
   14, 1, 10, 4, 7,  2, 9,
    3, 6, 15, 8, 3, 12, 0
-};
+}};
 
-int pNPCPortraits_x[6][6] =     // 004E5E50
-{
+std::array< std::array<int, 6>, 6> pNPCPortraits_x =     // 004E5E50
+{{
   {521,   0,   0,   0,   0,  0},
   {521, 521,   0,   0,   0,  0},
   {521, 521, 521,   0,   0,  0},
   {521, 486, 564, 521,   0,  0},
   {521, 486, 564, 486, 564,  0},
   {486, 564, 486, 564, 486, 564}
-};
-int pNPCPortraits_y[6][6] =     // 004E5EE0
-{
+}};
+std::array< std::array<int, 6>, 6> pNPCPortraits_y =     // 004E5EE0
+{{
   {38,   0,   0,   0,   0,   0},
   {38, 165,   0,   0,   0,   0},
   {38, 133, 228,   0,   0,   0},
   {38, 133, 133, 228,   0,   0},
   {38, 133, 133, 228, 228,   0},
   {38,  38, 133, 133, 228, 228}
-};
-const char *pHouse_ExitPictures[11]=
+}};
+std::array<const char *, 11> pHouse_ExitPictures=
 {
 	"",
 	"ticon01",
@@ -570,7 +570,7 @@
 };
 
 int bWinNT4_0; // weak
-__int16 word_4E8152[11] = {0, 0, 0, 90, 8, 2, 70, 20, 10, 50, 30};
+std::array<__int16, 11> word_4E8152 = {0, 0, 0, 90, 8, 2, 70, 20, 10, 50, 30};
 
 stru355 stru_4E82A4 = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000};
 stru355 stru_4EFCBC = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000};
@@ -580,20 +580,20 @@
 char byte_4E94D3 = 10; // weak
 int dword_4E98BC_bApplicationActive; // weak
 //char *off_4EB080; // idb
-char *pTransitionStrings[465] = {"", nullptr};  // 004EB080
-const char *pPlayerPortraitsNames[25] =
-{
+std::array<char*, 465> pTransitionStrings = {"", nullptr};  // 004EB080
+std::array<const char*, 25> pPlayerPortraitsNames =
+{{
   "pc01-", "pc02",  "pc03", "pc04",  "pc05-",
   "pc06",  "pc07",  "pc08", "pc09-", "pc10",
   "pc11-", "pc12",  "pc13", "pc14",  "pc15",
   "pc16",  "pc17-", "pc18", "pc19",  "pc20",
   "pc21-", "pc22-", "pc23", "pc24-", "pc25-"
-};
+}};
 
 
 
-unsigned char byte_4ECF08[48][25] =      // 4ECF08
-{
+std::array< std::array<unsigned char, 25>, 48> byte_4ECF08 =      // 4ECF08
+{{
   {2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 1},//1
   {2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2},//2
   {2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},//3
@@ -642,7 +642,7 @@
   {1, 1, 1, 2, 2, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1, 2, 1, 2, 2},//46
   {1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1},//47
   {1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1},//48
-};
+}};
 unsigned char SoundSetAction[110][8] = // 4ED3D8
 {
   { 0,  0,  0,  0,  0,  0,  0,  0},
@@ -756,9 +756,9 @@
   {14,  0,  0, 48,  0,  0,  0,  0},
   {17,  0,  0,  0,  0,  0,  0,  0}
 };
-__int16 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[4] = {34, 149, 264, 379};
-char byte_4ED970_skill_learn_ability_by_class_table[36][37] = 
-{
+std::array<__int16, 4> pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing = {34, 149, 264, 379};
+std::array< std::array<char, 37>, 36> byte_4ED970_skill_learn_ability_by_class_table = 
+{{
  2, 3, 2, 3, 3, 2, 3, 4, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 0, 2, 1, 0, 1, 2, 2, 0, 3, 0, 0, 1,//Knight
  2, 3, 2, 3, 3, 2, 3, 4, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 0, 2, 1, 0, 1, 2, 2, 0, 3, 0, 0, 1,
  2, 4, 2, 3, 4, 2, 3, 4, 4, 3, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 0, 2, 1, 0, 1, 2, 2, 0, 4, 0, 0, 1,
@@ -803,17 +803,17 @@
  3, 0, 2, 0, 0, 1, 0, 4, 0, 2, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 3, 1, 2, 0, 3, 2, 1, 0, 0, 0, 0, 3, 0, 0, 3, 3,
  3, 0, 2, 0, 0, 1, 0, 4, 0, 2, 0, 0, 4, 4, 4, 4, 0, 0, 0, 4, 0, 4, 1, 2, 0, 3, 2, 1, 0, 0, 0, 0, 4, 0, 0, 3, 3,
  3, 0, 2, 0, 0, 1, 0, 4, 0, 2, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 4, 4, 1, 2, 0, 3, 2, 1, 0, 0, 0, 0, 4, 0, 0, 3, 3,
-};
-int dword_4EDEA0[777]; // weak
-int dword_4EDEB4[777]; // weak
-int dword_4EDEC4[777]; // weak
+}};
+std::array<int, 777> dword_4EDEA0; // weak
+std::array<int, 777> dword_4EDEB4; // weak
+std::array<int, 777> dword_4EDEC4; // weak
 _UNKNOWN unk_4EDF40; // weak
-unsigned int pHiredNPCsIconsOffsetsX[2] = {489, 559};
-unsigned int pHiredNPCsIconsOffsetsY[2] = {152, 152};
-int dword_4EE07C[2]; // weak
+std::array<unsigned int, 2> pHiredNPCsIconsOffsetsX = {489, 559};
+std::array<unsigned int, 2> pHiredNPCsIconsOffsetsY = {152, 152};
+std::array<int, 2> dword_4EE07C; // weak
 _UNKNOWN unk_4EE084; // weak
-__int16 word_4EE088_sound_ids[100] =
-{
+std::array<__int16, 100> word_4EE088_sound_ids =
+{{
       0, 10000, 10010, 10020, 10030, 10040, 10050, 10060, 10070, 10080,
   10090, 10100, 11000, 11010, 11020, 11030, 11040, 11050, 11060, 11070,
   11080, 11090, 11100, 12000, 12010, 12020, 12030, 12040, 12050, 12060,
@@ -824,12 +824,12 @@
   16030, 16040, 16050, 16060, 16070, 16080, 16090, 16100, 17000, 17010,
   17020, 17030, 17040, 17050, 17060, 17070, 17080, 17090, 17100, 18000,
   18010, 18020, 18030, 18040, 18050, 18060, 18070, 18080, 18090, 18100
-};
-short word_4EE150[28] =
-{
+}};
+std::array<short, 28> word_4EE150 =
+{{
    1,  2,  3,  4,  5,  7, 32, 33, 36, 37, 38, 40, 41, 42, 43, 45, 46,
   47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 60
-};
+}};
 
 int dword_4EED78; // weak
 _UNKNOWN unk_4EED80; // weak
@@ -837,36 +837,36 @@
 int dword_4EFA84; // weak
 void *off_4EFDB0; // weak
 int dword_4F031C[777]; // weak
-const char *off_4F03B8[19] =
-{
+std::array<const char *, 19> off_4F03B8 =
+{{
   "",         "WEPNTABL", "ARMORY",   "MAGSHELF",
   "MAGSHELF", "MAGSHELF", "MAGSHELF", "MAGSHELF",
   "MAGSHELF", "MAGSHELF", "MAGSHELF", "MAGSHELF",
   "MAGSHELF", "MAGSHELF", "MAGSHELF", "MAGSHELF",
   "MAGSHELF", "MAGSHELF", "MAGSHELF"
-};
+}};
 
-int guild_mambership_flags[32]={
+std::array<int, 32> guild_mambership_flags={{
    54, 54, 54, 54, 52, 52, 52, 52, 55, 55, 55, 55, 53, 53,
 	   53, 53, 58, 58, 58, 58, 57, 57, 57, 57, 56, 56,
-	   56, 56, 59, 59, 60, 60};
-__int16 word_4F0754[49];
-__int16 _4F0882_evt_VAR_PlayerItemInHands_vals[54] =
-{
+     56, 56, 59, 59, 60, 60}};
+std::array<__int16, 49> word_4F0754;
+std::array<__int16, 54> _4F0882_evt_VAR_PlayerItemInHands_vals =
+{{
 	0x0D4, 0x270, 0x0D5, 0x21C, 0x0D6, 0x2BE, 0x0D7, 0x2BD, 0x0D8, 0x289, 
 	0x0D9, 0x258, 0x0DA, 0x2AB, 0x0DB, 0x281, 0x0DC, 0x280, 0x0DD,
 	0x284, 0x0DE, 0x285, 0x0DF, 0x283, 0x0E0, 0x282, 0x0E1, 0x27F,
 	0x0E2, 0x1E7, 0x0E3, 0x287, 0x0E4, 0x272, 0x0E5, 0x267, 0x0E6,
 	0x275, 0x0E7, 0x25A, 0x0E8, 0x2A4, 0x0E9, 0x2A5, 0x0EA, 0x2A3,
 	0x0EB, 0x25C, 0x0EC, 0x25D, 0x0ED, 0x259, 0x0F1, 0x21E
-};
-unsigned short pMaxLevelPerTrainingHallType[6] = {5, 15, 25, 25, 200, 200};
+}};
+std::array<unsigned short, 6> pMaxLevelPerTrainingHallType = {5, 15, 25, 25, 200, 200};
 
-int price_for_membership[11]={100, 100, 50, 50, 50, 50, 50, 50, 50, 1000, 1000}; // weak
+std::array<int, 11> price_for_membership={100, 100, 50, 50, 50, 50, 50, 50, 50, 1000, 1000}; // weak
 
 
-Vec2_int_ pMonsterArenaPlacements[20];
-__int16 word_4F0F30[32] ={ 4, 7, 10, 11,                                              
+std::array<Vec2_int_, 20> pMonsterArenaPlacements;
+std::array<__int16, 32> word_4F0F30 ={{ 4, 7, 10, 11,                                              
 						   4, 7, 10, 11,
 					       4, 7, 10, 11,
 						   4, 7, 10, 11,
@@ -874,28 +874,28 @@
 					       4, 7, 10, 11,
 					       4, 7, 10, 11,
 					       7, 11,
-						   7, 11};
+                 7, 11}};
 double dbl_4F2870; // weak
 int dword_4F288C; // weak
 double dbl_4F5372; // weak
 int dword_4F5428[777]; // weak
 int dword_4F542C[777]; // weak
 _UNKNOWN crtunk_4F54B8; // weak
-int dword_4F5B24_ys[777]; // idb
-int dword_4F5BF4_xs[777]; // idb
-int dword_4F5CC4_ys[777]; // idb
-int dword_4F5D98_xs[777]; // idb
-int ai_array_4F5E68[500];
-int ai_array_4F6638_actor_ids[500];
-int ai_near_actors_targets_pid[500];
+std::array<int, 777> dword_4F5B24_ys; // idb
+std::array<int, 777> dword_4F5BF4_xs; // idb
+std::array<int, 777> dword_4F5CC4_ys; // idb
+std::array<int, 777> dword_4F5D98_xs; // idb
+std::array<int, 500> ai_array_4F5E68;
+std::array<int, 500> ai_array_4F6638_actor_ids;
+std::array<int, 500> ai_near_actors_targets_pid;
 int ai_arrays_size; // weak
-int ai_near_actors_distances[500];
-unsigned int ai_near_actors_ids[500];
-int dword_4F8580[121]; // weak
+std::array<int, 500> ai_near_actors_distances;
+std::array<unsigned int, 500> ai_near_actors_ids;
+std::array<int, 121> dword_4F8580; // weak
 int dword_4FA9B0[777]; // weak
 int dword_4FA9B4[777]; // weak
 char byte_4FAA00; // weak
-__int16 am_sounds[12];
+std::array<__int16, 12> am_sounds;
 _UNKNOWN unk_4FAA20; // weak
 char byte_4FAA24; // weak
 HWND dword_4FAA28; // idb
@@ -908,8 +908,8 @@
 int am_uint_4FAA44_blt_xy[2];
 int amuint_4FAA4C; // weak
 unsigned int uCardID; // idb
-int amuint_4FAA54_blt_xy[2];
-int amuint_4FAA5C_blt_xy[2];
+std::array<int, 2> amuint_4FAA54_blt_xy;
+std::array<int, 2> amuint_4FAA5C_blt_xy;
 int dword_4FAA64; // weak
 int dword_4FAA68; // weak
 
@@ -918,10 +918,10 @@
 char am_byte_4FAA75; // weak
 char am_byte_4FAA76; // weak
 
-int amuint_4FAA78[777]; // weak
+std::array<int, 777> amuint_4FAA78; // weak
 char am_byte_4FAA7C[777]; // weak
-int amuint_4FAA80[777]; // weak
-int amuint_4FAA84[777]; // weak
+std::array<int, 777> amuint_4FAA80; // weak
+std::array<int, 777> amuint_4FAA84; // weak
 int amuint_4FAA88[777]; // weak
 int amuint_4FAA8C[777]; // weak
 int amuint_4FAA90[777][2];
@@ -957,9 +957,9 @@
 char byte_505881; // weak
 
 int dword_505890; // weak
-unsigned int pSRZBufferLineOffsets[480];
+std::array<unsigned int, 480> pSRZBufferLineOffsets;
 int areWeLoadingTexture; // weak
-char byte_506130[777]; // weak
+std::array<char, 777> byte_506130; // weak
 int dword_506338; // weak
 int dword_50633C; // idb
 signed int sRecoveryTime; // idb
@@ -983,26 +983,26 @@
 int BtnUp_flag; //BtnUp_flag
 int quick_spell_at_page; // weak
 char byte_506550; // weak
-char *aMoonPhaseNames[5];
+std::array<char *, 5> aMoonPhaseNames;
 int _506568_autonote_type; // weak
 char bRecallingBeacon; // weak
 int uLastPointedObjectID; // weak
 //unsigned __int8 bMonsterInfoUI_bDollInitialized;
-char *aSpellNames[44];
+std::array<char *, 44> aSpellNames;
 int pMainScreenNum; // weak
 int dword_506980_uW; // weak
 int dword_506984_uZ; // weak
 int dword_506988_uY; // weak
 int dword_50698C_uX; // weak
 int uGameMenuUI_CurentlySelectedKeyIdx; // 506E68
-unsigned int pPrevVirtualCidesMapping[27];
+std::array<unsigned int, 27> pPrevVirtualCidesMapping;
 int KeyboardPageNum; // weak
-int dword_506F0C[777]; // idb
+std::array<int, 777> dword_506F0C; // idb
 int uRestUI_FoodRequiredToRest;
 int dword_506F14; // weak
 int _506F18_num_hours_to_sleep; // weak
 int dword_506F1C; // weak
-int pVisibleWindowsIdxs[20]; // weak
+std::array<int, 20> pVisibleWindowsIdxs; // weak
 int uNumVisibleWindows;
 char bFlashHistoryBook; // weak
 char bFlashAutonotesBook; // weak
@@ -1022,10 +1022,10 @@
 unsigned int uGameUIFontShadow;
 unsigned int uGameUIFontMain;
 int dword_507B00_spell_info_to_draw_in_popup; // weak
-char *aMonthNames[12];
-char *aDayNames[7];
-char *aSpellSchoolNames[9];
-char *aAttributeNames[7];
+std::array<char *, 12> aMonthNames;
+std::array<char *, 7> aDayNames;
+std::array<char *, 9> aSpellSchoolNames;
+std::array<char *, 7> aAttributeNames;
 int dword_507B94; // weak
 int dword_507B98_ctrl_pressed; // weak
 unsigned int uActiveCharacter;
@@ -1035,8 +1035,8 @@
 __int64 GameUI_RightPanel_BookFlashTimer; // weak
 int _507CD4_RestUI_hourglass_anim_controller; // weak
 int dword_507CD8; // weak
-int dword_50B570[50]; // weak
-int dword_50B638[50]; // weak
+std::array<int, 50> dword_50B570; // weak
+std::array<int, 50> dword_50B638; // weak
 stru367 stru_50B700;
 /*int stru_50B700.field_0; // weak
 int stru_50B700.field_38[777]; // idb
@@ -1056,14 +1056,14 @@
 int dword_50BAE8[777]; // weak
 int stru_50B700._xs2[3 + 45]; // weak
 int stru_50B700._xs3[48]; // weak*/
-int dword_50BC10[100]; // weak
-int dword_50BDA0[100]; // weak
-int dword_50BF30[100]; // weak
+std::array<int, 100> dword_50BC10; // weak
+std::array<int, 100> dword_50BDA0; // weak
+std::array<int, 100> dword_50BF30; // weak
 char town_portal_caster_id; // weak
 int some_active_character; // weak
 //_UNKNOWN unk_50C190; // weak
 int dword_50C968; // weak
-unsigned int pIconIDs_Turn[5];
+std::array<unsigned int, 5> pIconIDs_Turn;
 unsigned int uIconID_TurnStop;
 unsigned int uIconID_TurnHour;
 int uIconID_CharacterFrame; // idb
@@ -1085,17 +1085,17 @@
 int dword_50CDCC; // weak
 int bProcessorIsNotIntel; // weak
 Vec3_int_ layingitem_vel_50FDFC;
-char pStartingMapName[777]; // idb
-unsigned __int8 IsPlayerWearingWatersuit[5];
-char party_has_equipment[54];
-char byte_5111F6[16];
+std::array<char, 777> pStartingMapName; // idb
+std::array<unsigned __int8, 5> IsPlayerWearingWatersuit;
+std::array<char, 54> party_has_equipment;
+std::array<char, 16> byte_5111F6;
 
 int _unused000; // weak
 
-unsigned __int16 pOdmMinimap[117][137];
+std::array<std::array<unsigned __int16, 137>, 117> pOdmMinimap;
 unsigned int uNumBlueFacesInBLVMinimap;
-unsigned __int16 pBlueFacesInBLVMinimapIDs[50];
-int pTextureIDs_PartyBuffIcons[14];
+std::array<unsigned __int16, 50> pBlueFacesInBLVMinimapIDs;
+std::array<int, 14> pTextureIDs_PartyBuffIcons;
 unsigned int uIconIdx_FlySpell;
 unsigned int uIconIdx_WaterWalk;
 int dword_576E28; // weak
@@ -1109,7 +1109,7 @@
 unsigned int uDialogueType;
 int sDialogue_SpeakingActorNPC_ID;
 struct LevelDecoration *_591094_decoration;
-char sHouseName[200]; // idb
+std::array<char, 200> sHouseName; // idb
 int uCurrentHouse_Animation; // weak
 char *dword_591164_teleport_map_name; // idb
 int dword_591168_teleport_speedz; // weak
@@ -1118,14 +1118,14 @@
 int dword_591174_teleportz; // weak
 int dword_591178_teleporty; // weak
 int dword_59117C_teleportx; // weak
-char byte_591180[6][100]; // idb
-struct NPCData *HouseNPCData[60];//array_5913D8 this array size temporarily increased to 60 from 6 to work aroud house overflow
+std::array<std::array<char, 100>, 6> byte_591180; // idb
+std::array<struct NPCData *, 60> HouseNPCData;//array_5913D8 this array size temporarily increased to 60 from 6 to work aroud house overflow
 
 struct Texture *pTexture_591428;
 struct Texture *pTexture_outside; // idb
 struct Texture *pTexture_Dialogue_Background;
 _UNKNOWN unk_597F10; // weak
-char byte_5B0938[2000];
+std::array<char, 2000> byte_5B0938;
 int EvtTargetObj; // 0x5B5920
 int _unused_5B5924_is_travel_ui_drawn = false; // 005B5924
 int _5B65A8_npcdata_uflags_or_other; // weak
@@ -1142,9 +1142,9 @@
 int dword_5C3418; // weak
 int dword_5C341C; // weak
 int _5C3420_pDecoration;
-char byte_5C3427[777]; // weak
-char GameUI_Footer_TimedString[200];
-char pFooterString[200];
+std::array<char, 777> byte_5C3427; // weak
+std::array<char, 200> GameUI_Footer_TimedString;
+std::array<char, 200> pFooterString;
 unsigned int GameUI_Footer_TimeLeft;
 int bForceDrawFooter; // weak
 int dword_5C35C0; // weak
@@ -1153,24 +1153,24 @@
 char *p2DEventsTXT_Raw;
 
 int dword_5C35D4; // weak
-char *aAMPMNames[2];
+std::array<char *, 2> aAMPMNames;
 char byte_5C45AF[777]; // weak
 
-char pFinalMessage[4096]; // idb
-char pTmpBuf[2000];
-char pTmpBuf2[2000];
-char byte_5C6D50[100]; // weak
+std::array<char, 4096> pFinalMessage; // idb
+std::array<char, 2000> pTmpBuf;
+std::array<char, 2000> pTmpBuf2;
+std::array<char, 100> byte_5C6D50; // weak
 int ui_current_text_color; // weak
 __int64 qword_5C6DF0; // weak
 int dword_5C6DF8; // weak
-char item__getname_buffer[104]; // idb
-char *pClassDescriptions[36];
-char *pAttributeDescriptions[7];
-char *pGrandSkillDesc[38];
-char *pMasterSkillDesc[38];
-char *pExpertSkillDesc[38];
-char *pNormalSkillDesc[38];
-char *pSkillDesc[38];
+std::array<char, 104> item__getname_buffer; // idb
+std::array<char *, 36> pClassDescriptions;
+std::array<char *, 7> pAttributeDescriptions;
+std::array<char *, 38> pGrandSkillDesc;
+std::array<char *, 38> pMasterSkillDesc;
+std::array<char *, 38> pExpertSkillDesc;
+std::array<char *, 38> pNormalSkillDesc;
+std::array<char *, 38> pSkillDesc;
 char *pHealthPointsAttributeDescription;
 char *pSpellPointsAttributeDescription;
 char *pArmourClassAttributeDescription;
@@ -1195,10 +1195,10 @@
 char *pSkillDescTXT_Raw;
 
 struct FactionTable *pFactionTable;
-char byte_5C8D1A[777]; // weak
+std::array<char, 777> byte_5C8D1A; // weak
 
-char byte_5E4C15[777]; // weak
-char *pSomeItemsNames[14];
+std::array<char, 777> byte_5E4C15; // weak
+std::array<char *, 14> pSomeItemsNames;
 
 char *pMonstersTXT_Raw;
 char *pMonsterPlacementTXT_Raw;
@@ -1208,11 +1208,11 @@
 char *pPotionsTXT_Raw;
 char *pPotionNotesTXT_Raw;
 
-int _6807B8_level_decorations_ids[777]; // idb
+std::array<int, 777> _6807B8_level_decorations_ids; // idb
 int _6807E0_num_decorations_with_sounds_6807B8; // weak
-int _6807E8_level_decorations_ids[777]; // idb
+std::array<int, 777> _6807E8_level_decorations_ids; // idb
 int _6836C8_num_decorations_6807E8; // weak
-int dword_69B010[64];
+std::array<int, 64> dword_69B010;
 float flt_69B138_dist; // weak
 char byte_69BD41_unused; // weak
 unsigned int uTextureID_x_u;
@@ -1246,7 +1246,7 @@
 int texmapping_terrain_subdivpow2; // weak
 int texmapping_building_subdivsize; // weak
 int texmapping_building_subdivpow2; // weak
-int unnamed_6BE060[2] = {0, 1};
+std::array<int, 2> unnamed_6BE060 = {{0, 1}};
 int mipmapping_building_mm1; // weak
 int mipmapping_building_mm2; // weak
 int mipmapping_building_mm3; // weak
@@ -1268,8 +1268,8 @@
 char outdoor_night_bottom_r; // weak
 char outdoor_night_bottom_g; // weak
 char outdoor_night_bottom_b; // weak
-char pDefaultSkyTexture[777]; // idb
-char byte_6BE124_cfg_textures_DefaultGroundTexture[16]; // idb
+std::array<char, 777> pDefaultSkyTexture; // idb
+std::array<char, 16> byte_6BE124_cfg_textures_DefaultGroundTexture; // idb
 int _6BE134_odm_main_tile_group; // weak
 int dword_6BE138; // weak
 int dword_6BE13C_uCurrentlyLoadedLocationID; // weak
@@ -1285,7 +1285,7 @@
 LONG uWindowStyle; // idb
 HMENU hOSMenu; // idb
 int dword_6BE340; // weak
-char pCurrentMapName[20]; // idb
+std::array<char, 20> pCurrentMapName; // idb
 unsigned int uLevelMapStatsID;
 int dword_6BE364_game_settings_1 = 0; // weak
 int dword_6BE368_debug_settings_2 = 0; // weak
@@ -1302,7 +1302,7 @@
 float flt_6BE3A4_debug_recmod1;
 float flt_6BE3A8_debug_recmod2;
 float flt_6BE3AC_debug_recmod1_x_1_6;
-char byte_6BE3B0[20]; // idb
+std::array<char, 20> byte_6BE3B0; // idb
 char bUnderwater = false; // weak
 char bNoNPCHiring = false; // weak
 int _702AC0_unused = 0; // weak
@@ -1315,26 +1315,26 @@
 bool bNoCD = false;
 bool bNoSound = false;
 int aborting_app; // weak
-int dword_720020_zvalues[100];
-int dword_7201B0_zvalues[299];
+std::array<int, 100> dword_720020_zvalues;
+std::array<int, 299> dword_7201B0_zvalues;
 int uTextureID_720980; // weak
 int _720984_unused; // weak
 char _72098C_unused; // weak
-__int16 word_7209A0_intercepts_ys_plus_ys[104];
-__int16 word_720A70_intercepts_xs_plus_xs[104];
-__int16 word_720B40_intercepts_zs[104];
-__int16 word_720C10_intercepts_xs[102];
+std::array<__int16, 104> word_7209A0_intercepts_ys_plus_ys;
+std::array<__int16, 104> word_720A70_intercepts_xs_plus_xs;
+std::array<__int16, 104> word_720B40_intercepts_zs;
+std::array<__int16, 102> word_720C10_intercepts_xs;
 int dword_720CDC;
-__int16 word_720CE0_ys[777]; // idb
-__int16 word_720DB0_xs[777]; // idb
-int dword_720E80[20];
-int dword_720ED0[20];
-int dword_720F20[20];
-__int16 word_720F70[777]; // idb
-__int16 word_721040[777]; // idb
-int dword_721110[777]; // idb
-int dword_721160[777]; // idb
-int odm_floor_level[20]; // idb
+std::array<__int16, 777> word_720CE0_ys; // idb
+std::array<__int16, 777> word_720DB0_xs; // idb
+std::array<int, 20> dword_720E80;
+std::array<int, 20> dword_720ED0;
+std::array<int, 20> dword_720F20;
+std::array<__int16, 777> word_720F70; // idb
+std::array<__int16, 777> word_721040; // idb
+std::array<int, 777> dword_721110; // idb
+std::array<int, 777> dword_721160; // idb
+std::array<int, 20> odm_floor_level; // idb
 int blv_prev_party_x; // weak
 int blv_prev_party_z; // weak
 int blv_prev_party_y; // weak
@@ -1342,43 +1342,43 @@
 char *dword_721664; // idb
 NPCTopic pNPCTopics[789];
 char *dword_722F10; // idb
-const char *pQuestTable[512];
+std::array<const char *, 512> pQuestTable;
 _UNKNOWN unk_723714; // weak
 char *dword_723718_autonote_related; // idb
 int dword_72371C[777]; // weak
-const char *pScrolls[82];
+std::array<const char *, 82> pScrolls;
 int dword_723E80_award_related[777]; // weak
 int dword_723E84[777]; // weak
 int dword_7241C8; // weak
 struct unk_F7B60C stru_73C834; // struct @ MM7.exe::0073C834
 
-char *aNPCProfessionNames[59];
+std::array<char *, 59> aNPCProfessionNames;
 char *pAwardsTXT_Raw;
 char *pScrollsTXT_Raw;
 char *pMerchantsTXT_Raw;
-const char *pMerchantsBuyPhrases[7];
-const char *pMerchantsSellPhrases[7];
-const char *pMerchantsRepairPhrases[7];
-const char *pMerchantsIdentifyPhrases[7];
+std::array<char *, 7> pMerchantsBuyPhrases;
+std::array<char *, 7> pMerchantsSellPhrases;
+std::array<char *, 7> pMerchantsRepairPhrases;
+std::array<char *, 7> pMerchantsIdentifyPhrases;
 char *pTransitionsTXT_Raw;
 char *pAutonoteTXT_Raw;
 char *pQuestsTXT_Raw;
  unsigned int    uNumTerrainNormals;
  struct Vec3_float_ *pTerrainNormals;
- unsigned short  pTerrainNormalIndices[128 * 128 * 2];
- unsigned int    pTerrainSomeOtherData[128 * 128 * 2];
+ std::array<unsigned short, 128 * 128 * 2>  pTerrainNormalIndices;
+ std::array<unsigned int, 128 * 128 * 2>    pTerrainSomeOtherData;
 struct unk_F7B60C stru_76D578; // struct @ MM7.exe::0076D578
 struct unk_F7B60C stru_76D590; // struct @ MM7.exe::0076D590
 struct unk_F7B60C stru_76D5A8; // struct @ MM7.exe::0076D5A8
 char byte_76D5C0; // weak
-int terrain_76D5C8[128];
-int terrain_76D7C8[128];
-int terrain_76D9C8[128];
-int terrain_76DBC8[128];
-int terrain_76DDC8[128];
-int terrain_76DFC8[128];
-int terrain_76E1C8[128];
-int terrain_76E3C8[128];
+std::array<int, 128> terrain_76D5C8;
+std::array<int, 128> terrain_76D7C8;
+std::array<int, 128> terrain_76D9C8;
+std::array<int, 128> terrain_76DBC8;
+std::array<int, 128> terrain_76DDC8;
+std::array<int, 128> terrain_76DFC8;
+std::array<int, 128> terrain_76E1C8;
+std::array<int, 128> terrain_76E3C8;
 
 _UNKNOWN unk_801A00; // weak
 _UNKNOWN unk_801A0C; // weak
@@ -1388,14 +1388,14 @@
 int dword_80AA1C; // weak
 int dword_80AA20; // weak
 unsigned int uNumElementsIn80AA28;
-struct stru148 *ptr_80AA28[2000];
+std::array<struct stru148 *, 2000> ptr_80AA28;
 struct Edge *pNewEdges;
 struct Surf *pSurfs;
 struct Edge *pEdges;
 struct Span *pSpans;
 struct Edge *ptr_80C978_Edges;
 struct Surf *ptr_80C97C_Surfs;
-struct Edge *ptr_80CA10[480];
+std::array<struct Edge *, 480> ptr_80CA10;
 _UNKNOWN unk_80D190; // weak
 int dword_A74C88; // weak
 unsigned int uPlayerCreationUI_SkySliderPos;
@@ -1405,34 +1405,34 @@
 struct Texture *pTexture_PlayerFaceMask;
 struct Texture *pTexture_PlayerFaceEradicated;
 struct Texture *pTexture_PlayerFaceDead;
-struct Texture *pTextures_PlayerFaces[4][56];
-struct Player *pPlayers[5];
+std::array< std::array<struct Texture *, 56>, 4> pTextures_PlayerFaces;
+std::array<struct Player *, 5> pPlayers;
 __int64 qword_A750D8; // weak
 __int16 word_A750E0; // weak
 __int16 word_A750E2; // weak
-char *pClassNames[36];
-char *aCharacterConditionNames[19];
-char *pSkillNames[38];
-char byte_AE3368[777]; // weak
+std::array<char *, 36> pClassNames;
+std::array<char *, 19> aCharacterConditionNames;
+std::array<char *, 38> pSkillNames;
+std::array<char, 777> byte_AE3368; // weak
 char byte_AE3369; // weak
 char byte_AE336A; // weak
 char byte_AE336B; // weak
 int dword_AE336C; // weak
 int dword_AE3370; // weak
 char byte_AE5B91; // weak
-int dword_F1B430[32]; // weak
+std::array<int, 32> dword_F1B430; // weak
 //int dword_F8B144; // nexindex [-1] to the following
-int player_levels[4] = {1, 1, 1, 1};
-__int16 word_F8B158[777]; // weak
+std::array<int, 4> player_levels = {{1, 1, 1, 1}};
+std::array<__int16, 777> word_F8B158; // weak
 struct Texture *ShopTexture; // idb
-struct Texture *ItemsInShopTexture[12];
+std::array<struct Texture *, 12> ItemsInShopTexture;
 __int16 word_F8B1A0; // weak
 const char *dword_F8B1A4; // idb
 int contract_approved; // weak
 int dword_F8B1AC_award_bit_number; // idb
 int dword_F8B1B0; // weak
 int gold_transaction_amount; // F8B1B4
-char *pShopOptions[4];
+std::array<char *, 4> pShopOptions;
 _UNKNOWN unk_F8B1C8; // weak
 int dword_F8B1D8; // weak
 int dword_F8B1DC; // weak
@@ -1440,8 +1440,8 @@
 int dword_F8B1E4; // weak
 const char *current_npc_text; // idb
 char dialogue_show_profession_details = false; // F8B1EC
-char byte_F8B1EF[777]; // weak
-char byte_F8B1F0[4];
+std::array<char, 777> byte_F8B1EF; // weak
+std::array<char, 4> byte_F8B1F0;
 int dword_F8B1F4; // weak
 
 
@@ -1449,8 +1449,8 @@
 //_UNKNOWN unk_F8BA50; // weak
 char byte_F8BC0C; // weak
 int bGameoverLoop = 0; // weak
-__int16 intersect_face_vertex_coords_list_a[104]; // word_F8BC48
-__int16 intersect_face_vertex_coords_list_b[104]; // word_F8BD18
+std::array<__int16, 104> intersect_face_vertex_coords_list_a; // word_F8BC48
+std::array<__int16, 104> intersect_face_vertex_coords_list_b; // word_F8BD18
 int dword_F93F20; // weak
 int dword_F93F70; // weak
 
--- a/mm7_data.h	Sat Jun 08 21:47:29 2013 +0200
+++ b/mm7_data.h	Sun Jun 09 00:30:48 2013 +0200
@@ -309,7 +309,7 @@
 extern int (__stdcall *off_4DAFDC)(char); // weak
 extern char asc_4DB724[]; // idb
 extern int dword_4DBD94; // weak
-extern int dword_4DF380[]; // weak
+extern std::array<int, 5> dword_4DF380; // weak
 extern int dword_4DF390; // weak
 extern char Str2[]; // idb
 
@@ -334,18 +334,18 @@
 extern char aIcons[]; // idb
 extern char aPending[]; // idb
 extern char aCanTFindS[]; // idb
-extern char *spellbook_texture_filename_suffices[]; // weak
+extern std::array<char *, 9> spellbook_texture_filename_suffices; // weak
 extern __int16 word_4E1D3A[]; // weak
-extern __int16 pTownPortalBook_xs[6];
-extern __int16 pTownPortalBook_ys[6];
-extern __int16 pTownPortalBook_ws[6];
-extern __int16 pTownPortalBook_hs[6];
-extern unsigned char pSpellbookSpellIndices[9][12]; // 4E2430
-extern unsigned int pLloydsBeaconsPreviewXs[5]; // 004E249C
-extern unsigned int pLloydsBeaconsPreviewYs[5];
-extern unsigned int pLloydsBeacons_SomeXs[5];
-extern unsigned int pLloydsBeacons_SomeYs[5]; // idb
-extern char aSbwb00[7]; // weak
+extern std::array<__int16, 6> pTownPortalBook_xs;
+extern std::array<__int16, 6> pTownPortalBook_ys;
+extern std::array<__int16, 6> pTownPortalBook_ws;
+extern std::array<__int16, 6> pTownPortalBook_hs;
+extern std::array<std::array<unsigned char, 12>, 9> pSpellbookSpellIndices; // 4E2430   from pSpellbookSpellIndices[9][12]
+extern std::array<unsigned int, 5> pLloydsBeaconsPreviewXs; // 004E249C
+extern std::array<unsigned int, 5> pLloydsBeaconsPreviewYs;
+extern std::array<unsigned int, 5> pLloydsBeacons_SomeXs;
+extern std::array<unsigned int, 5> pLloydsBeacons_SomeYs; // idb
+extern std::array<char, 7> aSbwb00; // weak
 extern char aW[2]; // idb
 extern char aA[2]; // idb
 extern char aSD[]; // idb
@@ -424,18 +424,18 @@
 extern char aS100110D02dSS[]; // idb
 extern int pCurrentScreen; // 004E28F8
 extern unsigned int uGammaPos;
-extern int BtnTurnCoord[8];
-extern __int16 RightClickPortraitXmin[4];
-extern __int16 RightClickPortraitXmax[4];
+extern std::array<int, 8> BtnTurnCoord;
+extern std::array<__int16, 4> RightClickPortraitXmin;
+extern std::array<__int16, 4> RightClickPortraitXmax;
 extern void *off_4E2A12; // weak
 //extern int pArmorSkills[5];
 //extern int pWeaponSkills[9];
 //extern int pMiscSkills[12];
 //extern int pMagicSkills[9];
-extern unsigned int pHealthBarPos[4];
-extern unsigned int pManaBarPos[4];
-extern char _4E2B21_buff_spell_tooltip_colors[80];
-extern unsigned char monster_popup_y_offsets[]; // weak
+extern std::array<unsigned int, 4> pHealthBarPos;
+extern std::array<unsigned int, 4> pManaBarPos;
+extern std::array<char, 80> _4E2B21_buff_spell_tooltip_colors;
+extern std::array<unsigned char, 88>  monster_popup_y_offsets; // weak
 extern unsigned char hourglass_icon_idx; // weak
 
 
@@ -446,96 +446,96 @@
 extern const char *format_4E2E10; // format text of resistance in Stats screen
 extern __int16 word_4E3C66[]; // idb
 extern int dword_4E455C; // weak
-extern int dword_4E4560[6];
-extern int dword_4E4578[6];
-extern int dword_4E4590[6];
-extern int dword_4E45A8[6];
+extern std::array<int, 6> dword_4E4560;
+extern std::array<int, 6> dword_4E4578;
+extern std::array<int, 6> dword_4E4590;
+extern std::array<int, 6> dword_4E45A8;
 extern _UNKNOWN dword_4E49D4; // idb
 extern int dword_4E4A18[]; // weak
 extern int dword_4E4A1C[]; // weak
 extern int dword_4E4A40[]; // weak
 extern int dword_4E4A44[]; // weak
-extern float flt_4E4A80[10];
+extern std::array<float, 10> flt_4E4A80;
 
-extern int pPartySpellbuffsUI_XYs[14][2];
-extern unsigned char byte_4E5DD8[]; // weak
-extern unsigned __int8 pPartySpellbuffsUI_smthns[14];
-extern int pNPCPortraits_x[6][6]; // 004E5E50
-extern int pNPCPortraits_y[6][6]; // 004E5EE0
-extern const char *pHouse_ExitPictures[11];
-extern const char *_4E6BDC_loc_names[11];
+extern std::array< std::array<int, 2>, 14> pPartySpellbuffsUI_XYs;
+extern std::array<unsigned char, 14> byte_4E5DD8; // weak
+extern std::array<unsigned __int8, 14> pPartySpellbuffsUI_smthns;
+extern std::array< std::array<int, 6>, 6> pNPCPortraits_x; // 004E5E50
+extern std::array< std::array<int, 6>, 6> pNPCPortraits_y; // 004E5EE0
+extern std::array<const char *, 11> pHouse_ExitPictures;
+extern std::array<const char *, 11> _4E6BDC_loc_names;
 extern int bWinNT4_0; // weak
-extern __int16 word_4E8152[11];
-extern char byte_4E8168[7][14];
+extern std::array<__int16, 11> word_4E8152;
+extern std::array< std::array<char, 14>, 7> byte_4E8168;
 #include "Texture.h"
 extern stru355 stru_4E82A4;// = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000};
 extern stru355 stru_4EFCBC;// = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000};
 extern char byte_4E94D0; // weak
 extern char _4E94D2_light_type; // weak
 extern char byte_4E94D3; // weak
-extern unsigned int saveload_dlg_xs[2];
-extern unsigned int saveload_dlg_ys[2];
-extern unsigned int saveload_dlg_zs[2];
-extern unsigned int saveload_dlg_ws[2];
+extern std::array<unsigned int, 2> saveload_dlg_xs;
+extern std::array<unsigned int, 2> saveload_dlg_ys;
+extern std::array<unsigned int, 2> saveload_dlg_zs;
+extern std::array<unsigned int, 2> saveload_dlg_ws;
 extern int dword_4E98BC_bApplicationActive; // weak
-extern char *pTransitionStrings[]; // 4EB080
-extern int dword_4EC268[]; // weak
-extern int dword_4EC28C[]; // weak
+extern std::array<char*, 465> pTransitionStrings; // 4EB080
+extern std::array<int, 9> dword_4EC268; // weak
+extern std::array<int, 7> dword_4EC28C; // weak
 extern int dword_4EC2A8; // weak
 extern int dword_4EC2AC; // weak
-extern const char *pPlayerPortraitsNames[25];
+extern std::array<const char*, 25> pPlayerPortraitsNames;
 
-extern unsigned char byte_4ECF08[48][25];
+extern std::array< std::array<unsigned char, 25>, 48> byte_4ECF08;
 extern unsigned char SoundSetAction[110][8]; // weak
-extern __int16 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[4];
-extern char byte_4ED970_skill_learn_ability_by_class_table[36][37];
-extern int dword_4EDEA0[]; // weak
-extern int dword_4EDEB4[]; // weak
-extern int dword_4EDEC4[]; // weak
+extern std::array<__int16, 4> pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
+extern std::array< std::array<char, 37>, 36> byte_4ED970_skill_learn_ability_by_class_table;
+extern std::array<int, 777> dword_4EDEA0; // weak
+extern std::array<int, 777> dword_4EDEB4; // weak
+extern std::array<int, 777> dword_4EDEC4; // weak
 extern _UNKNOWN unk_4EDF40; // weak
-extern unsigned int pHiredNPCsIconsOffsetsX[2];
-extern unsigned int pHiredNPCsIconsOffsetsY[2];
-extern int dword_4EE07C[2]; // weak
+extern std::array<unsigned int, 2> pHiredNPCsIconsOffsetsX;
+extern std::array<unsigned int, 2> pHiredNPCsIconsOffsetsY;
+extern std::array<int, 2> dword_4EE07C; // weak
 extern _UNKNOWN unk_4EE084; // weak
-extern __int16 word_4EE088_sound_ids[]; // weak
-extern short word_4EE150[];
+extern std::array<__int16, 100> word_4EE088_sound_ids; // weak
+extern std::array<short, 28> word_4EE150;
 extern int dword_4EED78; // weak
 extern _UNKNOWN unk_4EED80; // weak
 extern int dword_4EFA80; // weak
 extern int dword_4EFA84; // weak
 extern void *off_4EFDB0; // weak
 extern int dword_4F031C[]; // weak
-extern const char *off_4F03B8[]; // idb
+extern std::array<const char *, 19> off_4F03B8; // idb
 extern __int16 word_4F0576[]; // weak
 
-extern int guild_mambership_flags[32];
-extern __int16 word_4F0754[49];
-extern __int16 _4F0882_evt_VAR_PlayerItemInHands_vals[54];
-extern unsigned short pMaxLevelPerTrainingHallType[];
-extern int price_for_membership[]; // weak
-extern Vec2_int_ pMonsterArenaPlacements[20];
-extern __int16 word_4F0F30[32]; // weak
+extern std::array<int, 32> guild_mambership_flags;
+extern std::array<__int16, 49> word_4F0754;
+extern std::array<__int16, 54> _4F0882_evt_VAR_PlayerItemInHands_vals;
+extern std::array<unsigned short, 6> pMaxLevelPerTrainingHallType;
+extern std::array<int, 11> price_for_membership; // weak
+extern std::array<Vec2_int_, 20> pMonsterArenaPlacements;
+extern std::array<__int16, 32> word_4F0F30; // weak
 extern double dbl_4F2870; // weak
 extern int dword_4F288C; // weak
 extern double dbl_4F5372; // weak
 extern int dword_4F5428[]; // weak
 extern int dword_4F542C[]; // weak
 extern _UNKNOWN crtunk_4F54B8; // weak
-extern int dword_4F5B24_ys[]; // idb
-extern int dword_4F5BF4_xs[]; // idb
-extern int dword_4F5CC4_ys[]; // idb
-extern int dword_4F5D98_xs[]; // idb
-extern int ai_array_4F5E68[500];
-extern int ai_array_4F6638_actor_ids[500];
-extern int ai_near_actors_targets_pid[500];
+extern std::array<int, 777> dword_4F5B24_ys; // idb
+extern std::array<int, 777> dword_4F5BF4_xs; // idb
+extern std::array<int, 777> dword_4F5CC4_ys; // idb
+extern std::array<int, 777> dword_4F5D98_xs; // idb
+extern std::array<int, 500> ai_array_4F5E68;
+extern std::array<int, 500> ai_array_4F6638_actor_ids;
+extern std::array<int, 500> ai_near_actors_targets_pid;
 extern int ai_arrays_size; // weak
-extern int ai_near_actors_distances[500];
-extern unsigned int ai_near_actors_ids[500];
-extern int dword_4F8580[]; // weak
+extern std::array<int, 500> ai_near_actors_distances;
+extern std::array<unsigned int, 500> ai_near_actors_ids;
+extern std::array<int, 121> dword_4F8580; // weak
 extern int dword_4FA9B0[]; // weak
 extern int dword_4FA9B4[]; // weak
 extern char byte_4FAA00; // weak
-extern __int16 am_sounds[12];
+extern std::array<__int16, 12> am_sounds;
 extern _UNKNOWN unk_4FAA20; // weak
 extern char byte_4FAA24; // weak
 extern HWND dword_4FAA28; // idb
@@ -547,8 +547,8 @@
 extern int am_uint_4FAA44_blt_xy[2];
 extern int amuint_4FAA4C; // weak
 extern unsigned int uCardID; // idb
-extern int amuint_4FAA54_blt_xy[2];
-extern int amuint_4FAA5C_blt_xy[2];
+extern std::array<int, 2> amuint_4FAA54_blt_xy;
+extern std::array<int, 2> amuint_4FAA5C_blt_xy;
 extern int dword_4FAA64; // weak
 extern int dword_4FAA68; // weak
 
@@ -557,10 +557,10 @@
 extern char am_byte_4FAA75; // weak
 extern char am_byte_4FAA76; // weak
 
-extern int amuint_4FAA78[777]; // weak
+extern std::array<int, 777> amuint_4FAA78; // weak
 extern char am_byte_4FAA7C[777]; // weak
-extern int amuint_4FAA80[777]; // weak
-extern int amuint_4FAA84[777]; // weak
+extern std::array<int, 777> amuint_4FAA80; // weak
+extern std::array<int, 777> amuint_4FAA84; // weak
 extern int amuint_4FAA88[777]; // weak
 extern int amuint_4FAA8C[777]; // weak
 extern int amuint_4FAA90[777][2];
@@ -594,9 +594,9 @@
 extern char byte_505881; // weak
 
 extern int dword_505890; // weak
-extern unsigned int pSRZBufferLineOffsets[480];
+extern std::array<unsigned int, 480> pSRZBufferLineOffsets;
 extern int areWeLoadingTexture; // weak
-extern char byte_506130[]; // weak
+extern std::array<char, 777> byte_506130; // weak
 extern int dword_506338; // weak
 extern int dword_50633C; // idb
 extern signed int sRecoveryTime; // idb
@@ -619,27 +619,27 @@
 extern int BtnUp_flag; //BtnUp_flag
 extern int quick_spell_at_page; // weak
 extern char byte_506550; // weak
-extern char *aMoonPhaseNames[5];
+extern std::array<char *, 5> aMoonPhaseNames;
 extern int _506568_autonote_type; // 506568
 extern char bRecallingBeacon; // weak
 extern int uLastPointedObjectID; // weak
 //extern unsigned __int8 bMonsterInfoUI_bDollInitialized;
-extern char *aSpellNames[44];
+extern std::array<char *, 44> aSpellNames;
 extern int pMainScreenNum; // weak
 extern int dword_506980_uW; // weak
 extern int dword_506984_uZ; // weak
 extern int dword_506988_uY; // weak
 extern int dword_50698C_uX; // weak
 extern int uGameMenuUI_CurentlySelectedKeyIdx; // 506E68
-extern bool GameMenuUI_InvaligKeyBindingsFlags[28]; // 506E6C
-extern unsigned int pPrevVirtualCidesMapping[27];
+extern std::array<bool, 28> GameMenuUI_InvaligKeyBindingsFlags; // 506E6C
+extern std::array<unsigned int, 27> pPrevVirtualCidesMapping;
 extern int KeyboardPageNum; // weak
-extern int dword_506F0C[]; // idb
+extern std::array<int, 777> dword_506F0C; // idb
 extern int uRestUI_FoodRequiredToRest;
 extern int dword_506F14; // weak
 extern int _506F18_num_hours_to_sleep; // weak
 extern int dword_506F1C; // weak
-extern int pVisibleWindowsIdxs[20]; // weak
+extern std::array<int, 20> pVisibleWindowsIdxs; // weak
 extern int uNumVisibleWindows;
 extern char bFlashHistoryBook; // weak
 extern char bFlashAutonotesBook; // weak
@@ -659,10 +659,10 @@
 extern unsigned int uGameUIFontShadow;
 extern unsigned int uGameUIFontMain;
 extern int dword_507B00_spell_info_to_draw_in_popup; // weak
-extern char *aMonthNames[12];
-extern char *aDayNames[7];
-extern char *aSpellSchoolNames[9];
-extern char *aAttributeNames[7];
+extern std::array<char *, 12> aMonthNames;
+extern std::array<char *, 7> aDayNames;
+extern std::array<char *, 9> aSpellSchoolNames;
+extern std::array<char *, 7> aAttributeNames;
 extern int dword_507B94; // weak
 extern int dword_507B98_ctrl_pressed; // weak
 extern unsigned int uActiveCharacter;
@@ -672,8 +672,8 @@
 extern __int64 GameUI_RightPanel_BookFlashTimer; // weak
 extern int _507CD4_RestUI_hourglass_anim_controller; // weak
 extern int dword_507CD8; // weak
-extern int dword_50B570[]; // weak
-extern int dword_50B638[]; // weak
+extern std::array<int, 50> dword_50B570; // weak
+extern std::array<int, 50> dword_50B638; // weak
 extern struct stru367 stru_50B700;
 /*extern int stru_50B700.field_0; // weak
 extern int stru_50B700.field_38[]; // idb
@@ -693,14 +693,14 @@
 extern int dword_50BAE8[]; // weak
 extern int stru_50B700._xs2[]; // weak
 extern int stru_50B700._xs3[]; // weak*/
-extern int dword_50BC10[]; // weak
-extern int dword_50BDA0[]; // weak
-extern int dword_50BF30[]; // weak
+extern std::array<int, 100> dword_50BC10; // weak
+extern std::array<int, 100> dword_50BDA0; // weak
+extern std::array<int, 100> dword_50BF30; // weak
 extern char town_portal_caster_id; // weak
 extern int some_active_character; // weak
 extern _UNKNOWN unk_50C190; // weak
 extern int dword_50C968; // weak
-extern unsigned int pIconIDs_Turn[5];
+extern std::array<unsigned int, 5> pIconIDs_Turn;
 extern unsigned int uIconID_TurnStop;
 extern unsigned int uIconID_TurnHour;
 extern int uIconID_CharacterFrame; // idb
@@ -722,19 +722,19 @@
 extern int dword_50CDCC; // weak
 extern int bProcessorIsNotIntel; // weak
 extern Vec3_int_ layingitem_vel_50FDFC;
-extern char pStartingMapName[]; // idb
-extern unsigned __int8 IsPlayerWearingWatersuit[5];
-extern char party_has_equipment[54];
-extern char byte_5111F6[];
-extern unsigned int papredoll_dbrds[16];
+extern std::array<char, 777> pStartingMapName; // idb
+extern std::array<unsigned __int8, 5> IsPlayerWearingWatersuit;
+extern std::array<char, 54> party_has_equipment;
+extern std::array<char, 16> byte_5111F6;
+extern std::array<unsigned int, 16> papredoll_dbrds;
 
 extern int bRingsShownInCharScreen; // weak
 extern int _unused000; // weak
 
-extern unsigned __int16 pOdmMinimap[117][137];
+extern std::array<std::array<unsigned __int16, 137>, 117> pOdmMinimap;
 extern unsigned int uNumBlueFacesInBLVMinimap;
-extern unsigned __int16 pBlueFacesInBLVMinimapIDs[50];
-extern int pTextureIDs_PartyBuffIcons[14];
+extern std::array<unsigned __int16, 50> pBlueFacesInBLVMinimapIDs;
+extern std::array<int, 14> pTextureIDs_PartyBuffIcons;
 extern unsigned int uIconIdx_FlySpell;
 extern unsigned int uIconIdx_WaterWalk;
 extern int dword_576E28; // weak
@@ -748,7 +748,7 @@
 extern unsigned int uDialogueType;
 extern signed int sDialogue_SpeakingActorNPC_ID;
 extern struct LevelDecoration *_591094_decoration;
-extern char sHouseName[200]; // idb
+extern std::array<char, 200> sHouseName; // idb
 extern int uCurrentHouse_Animation; // weak
 extern char *dword_591164_teleport_map_name; // idb
 extern int dword_591168_teleport_speedz; // weak
@@ -757,14 +757,14 @@
 extern int dword_591174_teleportz; // weak
 extern int dword_591178_teleporty; // weak
 extern int dword_59117C_teleportx; // weak
-extern char byte_591180[6][100]; // idb
-extern struct NPCData *HouseNPCData[60]; //this array size temporarily increased to 60 from 6 to work aroud house overflow
+extern std::array<std::array<char, 100>, 6> byte_591180; // idb
+extern std::array<struct NPCData *, 60> HouseNPCData; //this array size temporarily increased to 60 from 6 to work aroud house overflow
 
 extern struct Texture *pTexture_591428;
 extern struct Texture *pTexture_outside; // idb
 extern struct Texture *pTexture_Dialogue_Background;
 extern _UNKNOWN unk_597F10; // weak
-extern char byte_5B0938[2000];
+extern std::array<char, 2000> byte_5B0938;
 extern int EvtTargetObj; // weak
 extern int _unused_5B5924_is_travel_ui_drawn; // 005B5924
 extern int _5B65A8_npcdata_uflags_or_other; // weak
@@ -781,9 +781,9 @@
 extern int dword_5C3418; // weak
 extern int dword_5C341C; // weak
 extern int _5C3420_pDecoration;
-extern char byte_5C3427[]; // weak
-extern char GameUI_Footer_TimedString[200];
-extern char pFooterString[200];
+extern std::array<char, 777> byte_5C3427; // weak
+extern std::array<char, 200> GameUI_Footer_TimedString;
+extern std::array<char, 200> pFooterString;
 extern unsigned int GameUI_Footer_TimeLeft;
 extern int bForceDrawFooter; // weak
 extern int dword_5C35C0; // weak
@@ -792,24 +792,24 @@
 extern char *p2DEventsTXT_Raw;
 
 extern int dword_5C35D4; // weak
-extern char *aAMPMNames[2];
+extern std::array<char *, 2> aAMPMNames;
 extern char byte_5C45AF[]; // weak
-extern char pTmpBuf3[];
-extern char pFinalMessage[4096]; // idb
-extern char pTmpBuf[2000];
-extern char pTmpBuf2[2000];
-extern char byte_5C6D50[]; // weak
+extern std::array<char, 10000> pTmpBuf3;
+extern std::array<char, 4096> pFinalMessage; // idb
+extern std::array<char, 2000> pTmpBuf;
+extern std::array<char, 2000> pTmpBuf2;
+extern std::array<char, 100> byte_5C6D50; // weak
 extern int ui_current_text_color; // weak
 extern __int64 qword_5C6DF0; // weak
 extern int dword_5C6DF8; // weak
-extern char item__getname_buffer[104]; // idb
-extern char *pClassDescriptions[36];
-extern char *pAttributeDescriptions[7];
-extern char *pGrandSkillDesc[38];
-extern char *pMasterSkillDesc[38];
-extern char *pExpertSkillDesc[38];
-extern char *pNormalSkillDesc[38];
-extern char *pSkillDesc[38];
+extern std::array<char, 104> item__getname_buffer; // idb
+extern std::array<char *, 36> pClassDescriptions;
+extern std::array<char *, 7> pAttributeDescriptions;
+extern std::array<char *, 38> pGrandSkillDesc;
+extern std::array<char *, 38> pMasterSkillDesc;
+extern std::array<char *, 38> pExpertSkillDesc;
+extern std::array<char *, 38> pNormalSkillDesc;
+extern std::array<char *, 38> pSkillDesc;
 extern char *pHealthPointsAttributeDescription;
 extern char *pSpellPointsAttributeDescription;
 extern char *pArmourClassAttributeDescription;
@@ -833,10 +833,10 @@
 extern char *pStatsTXT_Raw;
 extern char *pSkillDescTXT_Raw;
 extern struct FactionTable *pFactionTable;
-extern char byte_5C8D1A[]; // weak
+extern std::array<char, 777> byte_5C8D1A; // weak
 
-extern char byte_5E4C15[]; // weak
-extern char *pSomeItemsNames[14];
+extern std::array<char, 777> byte_5E4C15; // weak
+extern std::array<char *, 14> pSomeItemsNames;
 
 extern char *pMonstersTXT_Raw;
 extern char *pMonsterPlacementTXT_Raw;
@@ -846,11 +846,11 @@
 extern char *pPotionsTXT_Raw;
 extern char *pPotionNotesTXT_Raw;
 
-extern int _6807B8_level_decorations_ids[]; // idb
+extern std::array<int, 777> _6807B8_level_decorations_ids; // idb
 extern int _6807E0_num_decorations_with_sounds_6807B8; // weak
-extern int _6807E8_level_decorations_ids[]; // idb
+extern std::array<int, 777> _6807E8_level_decorations_ids; // idb
 extern int _6836C8_num_decorations_6807E8; // weak
-extern int dword_69B010[64];
+extern std::array<int, 64> dword_69B010;
 extern float flt_69B138_dist; // weak
 extern char byte_69BD41_unused; // weak
 extern unsigned int uTextureID_x_u;
@@ -884,7 +884,7 @@
 extern int texmapping_terrain_subdivpow2; // weak
 extern int texmapping_building_subdivsize; // weak
 extern int texmapping_building_subdivpow2; // weak
-extern int unnamed_6BE060[2];
+extern std::array<int, 2> unnamed_6BE060;
 extern int mipmapping_building_mm1; // weak
 extern int mipmapping_building_mm2; // weak
 extern int mipmapping_building_mm3; // weak
@@ -906,8 +906,8 @@
 extern char outdoor_night_bottom_r; // weak
 extern char outdoor_night_bottom_g; // weak
 extern char outdoor_night_bottom_b; // weak
-extern char pDefaultSkyTexture[]; // idb
-extern char byte_6BE124_cfg_textures_DefaultGroundTexture[16]; // idb
+extern std::array<char, 777> pDefaultSkyTexture; // idb
+extern std::array<char, 16> byte_6BE124_cfg_textures_DefaultGroundTexture; // idb
 extern int _6BE134_odm_main_tile_group; // weak
 extern int dword_6BE138; // weak
 extern int dword_6BE13C_uCurrentlyLoadedLocationID; // weak
@@ -926,7 +926,7 @@
 extern LONG uWindowStyle; // idb
 extern HMENU hOSMenu; // idb
 extern int dword_6BE340; // weak
-extern char pCurrentMapName[20]; // idb
+extern std::array<char, 20> pCurrentMapName; // idb
 extern unsigned int uLevelMapStatsID;
 extern int dword_6BE364_game_settings_1; // weak
 extern int dword_6BE368_debug_settings_2; // weak
@@ -943,7 +943,7 @@
 extern float flt_6BE3A4_debug_recmod1;
 extern float flt_6BE3A8_debug_recmod2;
 extern float flt_6BE3AC_debug_recmod1_x_1_6;
-extern char byte_6BE3B0[20]; // idb
+extern std::array<char, 20> byte_6BE3B0; // idb
 extern char bUnderwater; // weak
 extern char bNoNPCHiring; // weak
 extern int _702AC0_unused; // weak
@@ -956,69 +956,69 @@
 extern bool bNoCD;
 extern bool bNoSound;
 extern int aborting_app; // weak
-extern int dword_720020_zvalues[100];
-extern int dword_7201B0_zvalues[299];
+extern std::array<int, 100> dword_720020_zvalues;
+extern std::array<int, 299> dword_7201B0_zvalues;
 extern int dword_7207F0[]; // idb
 extern int uTextureID_720980; // weak
 extern int _720984_unused; // weak
 extern char _72098C_unused; // weak
-extern __int16 word_7209A0_intercepts_ys_plus_ys[104];
-extern __int16 word_720A70_intercepts_xs_plus_xs[104];
-extern __int16 word_720B40_intercepts_zs[104];
-extern __int16 word_720C10_intercepts_xs[102];
+extern std::array<__int16, 104> word_7209A0_intercepts_ys_plus_ys;
+extern std::array<__int16, 104> word_720A70_intercepts_xs_plus_xs;
+extern std::array<__int16, 104> word_720B40_intercepts_zs;
+extern std::array<__int16, 102> word_720C10_intercepts_xs;
 extern int dword_720CDC;
-extern __int16 word_720CE0_ys[]; // idb
-extern __int16 word_720DB0_xs[]; // idb
-extern int dword_720E80[20];
-extern int dword_720ED0[20];
-extern int dword_720F20[20];
-extern __int16 word_720F70[]; // idb
-extern __int16 word_721040[]; // idb
-extern int dword_721110[]; // idb
-extern int dword_721160[]; // idb
-extern int odm_floor_level[20]; // idb dword_7211B0
+extern std::array<__int16, 777> word_720CE0_ys; // idb
+extern std::array<__int16, 777> word_720DB0_xs; // idb
+extern std::array<int, 20> dword_720E80;
+extern std::array<int, 20> dword_720ED0;
+extern std::array<int, 20> dword_720F20;
+extern std::array<__int16, 777> word_720F70; // idb
+extern std::array<__int16, 777> word_721040; // idb
+extern std::array<int, 777> dword_721110; // idb
+extern std::array<int, 777> dword_721160; // idb
+extern std::array<int, 20> odm_floor_level; // idb dword_7211B0
 extern int blv_prev_party_x; // weak
 extern int blv_prev_party_z; // weak
 extern int blv_prev_party_y; // weak
 extern char *dword_721660; // idb
 extern char *dword_721664; // idb
 extern char *dword_722F10; // idb
-extern const char *pQuestTable[512];
+extern std::array<const char *, 512> pQuestTable;
 extern _UNKNOWN unk_723714; // weak
 extern char *dword_723718_autonote_related; // idb
 extern int dword_72371C[]; // weak
-extern const char *pScrolls[82];
+extern std::array<const char *, 82> pScrolls;
 extern int dword_723E80_award_related[]; // weak
 extern int dword_723E84[]; // weak
 extern int dword_7241C8; // weak
 
-extern char *aNPCProfessionNames[59];
+extern std::array<char *, 59> aNPCProfessionNames;
 extern char *pAwardsTXT_Raw;
 extern char *pScrollsTXT_Raw;
 extern char *pMerchantsTXT_Raw;
-extern const char *pMerchantsBuyPhrases[7];
-extern const char *pMerchantsSellPhrases[7];
-extern const char *pMerchantsRepairPhrases[7];
-extern const char *pMerchantsIdentifyPhrases[7];
+extern std::array<char *, 7> pMerchantsBuyPhrases;
+extern std::array<char *, 7> pMerchantsSellPhrases;
+extern std::array<char *, 7> pMerchantsRepairPhrases;
+extern std::array<char *, 7> pMerchantsIdentifyPhrases;
 extern char *pTransitionsTXT_Raw;
 extern char *pAutonoteTXT_Raw;
 extern char *pQuestsTXT_Raw;
 extern unsigned int    uNumTerrainNormals;
 extern struct Vec3_float_ *pTerrainNormals;
-extern unsigned short  pTerrainNormalIndices[128 * 128 * 2];
-extern unsigned int    pTerrainSomeOtherData[128 * 128 * 2];
+extern std::array<unsigned short, 128 * 128 * 2>  pTerrainNormalIndices;
+extern std::array<unsigned int, 128 * 128 * 2>    pTerrainSomeOtherData;
 extern char byte_76D5C0;
 extern struct unk_F7B60C stru_76D578;
 extern struct unk_F7B60C stru_76D590;
 extern struct unk_F7B60C stru_76D5A8;
-extern int terrain_76D5C8[128];
-extern int terrain_76D7C8[128];
-extern int terrain_76D9C8[128];
-extern int terrain_76DBC8[128];
-extern int terrain_76DDC8[128];
-extern int terrain_76DFC8[128];
-extern int terrain_76E1C8[128];
-extern int terrain_76E3C8[128];
+extern std::array<int, 128> terrain_76D5C8;
+extern std::array<int, 128> terrain_76D7C8;
+extern std::array<int, 128> terrain_76D9C8;
+extern std::array<int, 128> terrain_76DBC8;
+extern std::array<int, 128> terrain_76DDC8;
+extern std::array<int, 128> terrain_76DFC8;
+extern std::array<int, 128> terrain_76E1C8;
+extern std::array<int, 128> terrain_76E3C8;
 struct unk_F7B60C
 {
  int   some_data_ptr;  // dword @ 000000
@@ -1037,14 +1037,14 @@
 extern int dword_80AA1C; // weak
 extern int dword_80AA20; // weak
 extern unsigned int uNumElementsIn80AA28;
-extern struct stru148 *ptr_80AA28[];
+extern std::array<struct stru148 *, 2000> ptr_80AA28;
 extern struct Edge *pNewEdges;
 extern struct Surf *pSurfs;
 extern struct Edge *pEdges;
 extern struct Span *pSpans;
 extern struct Edge *ptr_80C978_Edges;
 extern struct Surf *ptr_80C97C_Surfs;
-extern struct Edge *ptr_80CA10[480];
+extern std::array<struct Edge *, 480> ptr_80CA10;
 extern _UNKNOWN unk_80D190; // weak
 extern int dword_A74C88; // weak
 extern unsigned int uPlayerCreationUI_SkySliderPos;
@@ -1054,34 +1054,34 @@
 extern struct Texture *pTexture_PlayerFaceMask;
 extern struct Texture *pTexture_PlayerFaceEradicated;
 extern struct Texture *pTexture_PlayerFaceDead;
-extern struct Texture *pTextures_PlayerFaces[4][56];
+extern std::array< std::array<struct Texture *, 56>, 4> pTextures_PlayerFaces;
 extern int dword_A75070; // weak
-extern struct Player *pPlayers[5];
+extern std::array<struct Player *, 5> pPlayers;
 extern __int64 qword_A750D8; // weak
 extern __int16 word_A750E0; // weak
 extern __int16 word_A750E2; // weak
-extern char *pClassNames[36];
-extern char *aCharacterConditionNames[19];
-extern char *pSkillNames[38];
-extern char byte_AE3368[]; // weak
+extern std::array<char *, 36> pClassNames;
+extern std::array<char *, 19> aCharacterConditionNames;
+extern std::array<char *, 38> pSkillNames;
+extern std::array<char, 777> byte_AE3368; // weak
 extern char byte_AE3369; // weak
 extern char byte_AE336A; // weak
 extern char byte_AE336B; // weak
 extern int dword_AE336C; // weak
 extern int dword_AE3370; // weak
 extern char byte_AE5B91; // weak
-extern int dword_F1B430[32]; // weak
-extern int player_levels[4];
-extern __int16 word_F8B158[]; // weak
+extern std::array<int, 32> dword_F1B430; // weak
+extern std::array<int, 4> player_levels;
+extern std::array<__int16, 777> word_F8B158; // weak
 extern struct Texture *ShopTexture; // idb
-extern struct Texture *ItemsInShopTexture[12];
+extern std::array<struct Texture *, 12> ItemsInShopTexture;
 extern __int16 word_F8B1A0; // weak
 extern const char *dword_F8B1A4; // idb
 extern int contract_approved; // weak
 extern int dword_F8B1AC_award_bit_number; // idb
 extern int dword_F8B1B0; // weak
 extern int gold_transaction_amount; // F8B1B4
-extern char *pShopOptions[4];
+extern std::array<char *, 4> pShopOptions;
 extern _UNKNOWN unk_F8B1C8; // weak
 extern int dword_F8B1D8; // weak
 extern int dword_F8B1DC; // weak
@@ -1089,8 +1089,8 @@
 extern int dword_F8B1E4; // weak
 extern const char *current_npc_text; // 0xF8B1E8
 extern char dialogue_show_profession_details; // weak
-extern char byte_F8B1EF[]; // weak
-extern char byte_F8B1F0[4];
+extern std::array<char, 777> byte_F8B1EF; // weak
+extern std::array<char, 4> byte_F8B1F0;
 extern int dword_F8B1F4; // weak
 
 
@@ -1099,8 +1099,8 @@
 //extern _UNKNOWN unk_F8BA50; // weak
 extern char byte_F8BC0C; // weak
 extern int bGameoverLoop; // weak
-extern __int16 intersect_face_vertex_coords_list_a[]; // word_F8BC48
-extern __int16 intersect_face_vertex_coords_list_b[]; // word_F8BD18
+extern std::array<__int16, 104> intersect_face_vertex_coords_list_a; // word_F8BC48
+extern std::array<__int16, 104> intersect_face_vertex_coords_list_b; // word_F8BD18
 //extern _UNKNOWN unk_F8EA04; // weak
 //extern _UNKNOWN unk_F8F8F8; // weak
 extern int dword_F93F20; // weak