changeset 811:d6e84d158052

Merge
author Gloval
date Tue, 26 Mar 2013 00:58:16 +0400
parents f5156b8c61ad (current diff) 7bb33867d2cb (diff)
children d37b03507b3b 35122475edd7
files mm7_3.cpp
diffstat 11 files changed, 88 insertions(+), 115 deletions(-) [+]
line wrap: on
line diff
--- a/Events.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/Events.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -338,12 +338,10 @@
 		memcpy(pSomeEVT_Events, pLevelEVT_Index, sizeof(EventIndex)*4400);
 		}
 
-
 	v4 = 0;
 	v124 = 0;
 	//for (uint i = 0; i < uSomeEVT_NumEvents; ++i)
 	//	{
-		
 		//v6 = v123;
 		//v7 = "";
 		while ( 1 )
@@ -1040,8 +1038,7 @@
 					sub_4451A8_press_any_key(uEventID, v105, v121);
 LABEL_301:
 					if ( v133 == 1 )
-LABEL_302:
-					OnMapLeave();
+						OnMapLeave();
 					return;
 					}
 				v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
@@ -1071,12 +1068,16 @@
 			case EVENT_ReceiveDamage:
 				v85 = EVT_DWORD(_evt->v7 );
 				v86 = _evt->v5;
-				if ( (unsigned __int8)v86 <= 3u )
+				if ( (unsigned __int8)v86 <= 3 )
 					{
 					v119 = _evt->v6;
 					v115 = EVT_DWORD(_evt->v7 );
 					v89 = (unsigned __int8)v86;
-					goto LABEL_233;
+					v88 = &pParty->pPlayers[v89];
+					v88->ReceiveDamage(v115, v119);
+					++curr_seq_num;
+					v4 = v124;
+					break;
 					}
 				if ( v86 == 4 )
 					{
@@ -1092,16 +1093,17 @@
 					v119 = _evt->v6;
 					v88 = pPlayers[uActiveCharacter];
 					v115 = EVT_DWORD(_evt->v7 );
-					goto LABEL_234;
+					v88->ReceiveDamage(v115, v119);
+					++curr_seq_num;
+					v4 = v124;
+					break;
 					}
 				if ( v86 != 5 )
 					{
 					v119 = _evt->v6;
 					v115 = EVT_DWORD(_evt->v7 );
 					v89 = rand() % 4;
-LABEL_233:
 					v88 = &pParty->pPlayers[v89];
-LABEL_234:
 					v88->ReceiveDamage(v115, v119);
 					++curr_seq_num;
 					v4 = v124;
@@ -1372,7 +1374,8 @@
 							pDialogueWindow = 0;
 							pIcons_LOD->_40F9C5();
 							}
-						goto LABEL_302;
+						OnMapLeave();
+						return;
 						}
 					}
 				++curr_seq_num;
--- a/Game.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/Game.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -334,7 +334,6 @@
       if ( pArcomageGame->bGameInProgress )
       {
         ArcomageGame::Loop();
-//LABEL_89:
         pRenderer->Present();
         continue;
       }
--- a/Indoor.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/Indoor.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -536,11 +536,14 @@
         if (pFace->Fluid() &&
             pFace->uBitmapID == pRenderer->hd_water_tile_id )
         {
-          __debugbreak();
           v23 = pRenderer->pHDWaterBitmapIDs[pRenderer->hd_water_current_frame];
-          goto LABEL_42;
+          v27 = pBitmaps_LOD->pHardwareTextures[v23];
+          if (pFace->uAttributes & FACE_DO_NOT_LIGHT)
+            _479A53_draw_some_blv_poly(uNumVerticesa, uFaceID);
+          else
+            pRenderer->DrawIndoorPolygon(uNumVerticesa, pFace, v27, v28, 8 * uFaceID | OBJECT_BModel, v17, 0);
+          return;
         }
-
         if (pFace->Fluid())
         {
           //auto v24 = GetTickCount() / 4;
@@ -552,14 +555,17 @@
           for (uint i = 0; i < uNumVerticesa; ++i)
             //array_507D30[i].v += (double)(pBitmaps_LOD->pTextures[pFace->uBitmapID].uHeightMinus1 & (unsigned int)(stru_5C6E00->SinCos(v25) >> 8));
             array_507D30[i].v += pBitmaps_LOD->pTextures[pFace->uBitmapID].uHeightMinus1 * cosf(angle);
-
           v23 = pFace->uBitmapID;
-          goto LABEL_42;
+          v27 = pBitmaps_LOD->pHardwareTextures[v23];
+          if (pFace->uAttributes & FACE_DO_NOT_LIGHT)
+            _479A53_draw_some_blv_poly(uNumVerticesa, uFaceID);
+          else
+            pRenderer->DrawIndoorPolygon(uNumVerticesa, pFace, v27, v28, 8 * uFaceID | OBJECT_BModel, v17, 0);
+          return;
         }
         else if (pFace->uAttributes & 0x4000)
         {
           v23 = pTextureFrameTable->GetFrameTexture(pFace->uBitmapID, pBLVRenderParams->field_0_timer_);
-LABEL_42:
           v27 = pBitmaps_LOD->pHardwareTextures[v23];
           if (pFace->uAttributes & FACE_DO_NOT_LIGHT)
             _479A53_draw_some_blv_poly(uNumVerticesa, uFaceID);
@@ -569,7 +575,12 @@
         }
         v17 = 0xFFFFFFFF;
         v23 = pFace->uBitmapID;
-        goto LABEL_42;
+        v27 = pBitmaps_LOD->pHardwareTextures[v23];
+        if (pFace->uAttributes & FACE_DO_NOT_LIGHT)
+          _479A53_draw_some_blv_poly(uNumVerticesa, uFaceID);
+        else
+          pRenderer->DrawIndoorPolygon(uNumVerticesa, pFace, v27, v28, 8 * uFaceID | OBJECT_BModel, v17, 0);
+        return;;
       }
     }
   }
--- a/Player.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/Player.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -1489,7 +1489,7 @@
   }
   else
   {
-    sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[67], this->pName);
+    sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[67], this->pName);
     ShowStatusBarString(pTmpBuf, 2u);
     result = 0;
   }
@@ -3597,7 +3597,7 @@
       v25 = pGlobalTXT_LocalizationStrings[377];
     }
     v23 = pTmpBuf2;
-    sprintf(pTmpBuf2, v25, v26);
+    sprintfex(pTmpBuf2, v25, v26);
     goto LABEL_43;
   }
   return 0;
@@ -7293,10 +7293,10 @@
       case 0x10Fu:
         v3->sAgeModifier = 0;
         goto LABEL_112;
+      case 0xDDu:
+        goto LABEL_172;
       default:
         goto LABEL_167;
-      case 0xDDu:
-        goto LABEL_172;
     }
     goto LABEL_172;
   }
@@ -7544,7 +7544,7 @@
       v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
       v58 = pGlobalTXT_LocalizationStrings[382];
 LABEL_90:
-      sprintf(pTmpBuf, v58, v68);
+      sprintfex(pTmpBuf, v58, v68);
       v23 = pTmpBuf;
 LABEL_91:
       ShowStatusBarString(v23, 2u);
@@ -7600,7 +7600,7 @@
             if ( v75 > v21 || !*v17 )
             {
               v22 = pParty->pPickedItem.GetDisplayName();
-              sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22);
+              sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22);
               ShowStatusBarString(pTmpBuf, 2u);
               v65 = 0;
               v56 = 20;
--- a/UICharacter.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/UICharacter.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -3996,7 +3996,7 @@
         pRenderer->DrawTextureIndexed(8, 8, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
         v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
         sprintf(pTmpBuf, "\f%05d", v3);
-        sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->classType]);//^Pi[%s] %s
+        sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->classType]);//^Pi[%s] %s
         strcat(pTmpBuf, pTmpBuf2);
         if ( pPlayer->uSkillPoints )
             v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0);
--- a/UIPopup.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/UIPopup.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -1767,7 +1767,7 @@
             if ( v15 > v14->uLevel )
                 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[147], v15);
             v16 = sub_4B46F8(v15) - LODWORD(v14->uExperience);
-            sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[538], v16, v15 + 1);
+            sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[538], v16, v15 + 1);
             strcat(pTmpBuf, "\n");
             strcat(pTmpBuf, pTmpBuf2);
             LOBYTE(_y) = sprintf(pTmpBuf2, "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf);
--- a/UiGame.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/UiGame.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -626,7 +626,7 @@
       }
       v31 = pSpriteObjects[v30].stru_24.GetDisplayName();
       v28 = pTmpBuf;
-      sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s"
+      sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s"
     }
     else
     {
--- a/mm7_3.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/mm7_3.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -1729,113 +1729,74 @@
   v82 = (unsigned __int64)(pEventTimer->dt_in_some_format
                          * (signed __int64)((signed int)(pParty->y_rotation_speed * stru_5C6E00->uIntegerPi)
                                           / 180)) >> 16;
-LABEL_87:
+//LABEL_87:
   while ( pPartyActionQueue->uNumActions )
   {
     switch ( pPartyActionQueue->Next() )
     {
       case PARTY_TurnLeft:
-        v12 = uTurnSpeed;
         if ( uTurnSpeed )
-          goto LABEL_58;
-        v13 = (double)v82 * fTurnSpeedMultiplier;
-        v14 = angle + (unsigned __int64)(signed __int64)v13;
+        {
+          v14 = angle + uTurnSpeed;
+          angle = stru_5C6E00->uDoublePiMask & v14;
+          break;
+        }
+        v14 = angle + (unsigned __int64)(signed __int64)(double)v82 * fTurnSpeedMultiplier;
         angle = stru_5C6E00->uDoublePiMask & v14;
-        goto LABEL_87;
+        break;
       case PARTY_TurnRight:
-        LODWORD(v15) = uTurnSpeed;
         if ( uTurnSpeed )
         {
-          angle = stru_5C6E00->uDoublePiMask & (angle - v15);
-          goto LABEL_87;
+          angle = stru_5C6E00->uDoublePiMask & (angle - uTurnSpeed);
+          break;
         }
         v16 = (double)v82 * fTurnSpeedMultiplier;
-        //{
-        v15 = (signed __int64)v16;
-        angle = stru_5C6E00->uDoublePiMask & (angle - v15);
-        goto LABEL_87;
-        //}
+        angle = stru_5C6E00->uDoublePiMask & (angle - (signed __int64)v16);
+        break;
       case PARTY_FastTurnLeft:
-        v12 = uTurnSpeed;
         if ( uTurnSpeed )
         {
-LABEL_58:
-          v14 = angle + v12;
+          v14 = angle + uTurnSpeed;
         }
         else
         {
-          v13 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
-          v14 = angle + (unsigned __int64)(signed __int64)v13;
+          v14 = angle + (unsigned __int64)(signed __int64)(fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
         }
         angle = stru_5C6E00->uDoublePiMask & v14;
-        goto LABEL_87;
+        break;
       case PARTY_FastTurnRight:
         LODWORD(v15) = uTurnSpeed;
         if ( !uTurnSpeed )
         {
-          v16 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
-          v15 = (signed __int64)v16;
+          v15 = (signed __int64)(fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
         }
         angle = stru_5C6E00->uDoublePiMask & (angle - v15);
-        goto LABEL_87;
-      case PARTY_StrafeLeft://Ctrl + <-
-        __debugbreak();
-        v17 = stru_5C6E00->Sin(angle);
-        v18 = (double)v81;
-        //v88 = v18;
-        v78 = (unsigned __int64)(v17 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
-        v2 -= v78;
-        v19 = stru_5C6E00->Cos(angle);
-        v78 = (unsigned __int64)(v19 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
-        v1 += v78;
+        break;
+      case PARTY_StrafeLeft:
+        v2 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16;
+        v1 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16;
         v78 = 1;
-        goto LABEL_87;
+        break;
       case PARTY_StrafeRight:
-        __debugbreak();
-        v20 = stru_5C6E00->Sin(angle);
-        v21 = (double)v81;
-        //v88 = v21;
-        v78 = (unsigned __int64)(v20 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
-        v2 += v78;
-        v22 = stru_5C6E00->Cos(angle);
-        v78 = (unsigned __int64)(v22 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
-        //goto LABEL_68;
-        v1 -= v78;
+        v2 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16;
+        v1 -= (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16;
         v78 = 1;
-        goto LABEL_87;
+        break;
       case PARTY_WalkForward:
-        __debugbreak();
-        v23 = stru_5C6E00->Cos(angle);
-        v24 = (double)v81;
-        //v88 = v24;
-        v78 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
-        v2 += v78;
-        v25 = stru_5C6E00->Sin(angle);
-        v78 = (unsigned __int64)(v25 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
-        v1 += v78;
+        v2 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier)) >> 16;
+        v1 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier)) >> 16;
         v78 = 1;
-        goto LABEL_87;
+        break;
       case PARTY_WalkBackward:
-        __debugbreak();
-        v26 = stru_5C6E00->Cos(angle);
-        v27 = (double)v81;
-        //v88 = v27;
-        v78 = (unsigned __int64)(v26 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16;
-        v2 -= v78;
-        v28 = stru_5C6E00->Sin(angle);
-        v78 = (unsigned __int64)(v28 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16;
-        v1 -= v78;
+        v2 -= (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16;
+        v1 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16;
         v78 = 1;
-        goto LABEL_87;
+        break;
       case PARTY_RunForward:
-        //v29 = stru_5C6E00->Cos(angle);
-        //v30 = (double)v81;
-        //v88 = (double)v81;
         v2 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16;
-        //v31 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
         v1 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16;
         v72 = 1;
-        goto LABEL_87;
+        break;
       case PARTY_RunBackward:
         //v32 = stru_5C6E00->SinCos(angle);
         //v33 = (double)v81;
@@ -1844,15 +1805,14 @@
         //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
         v1 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16;
         v72 = 1;
-        goto LABEL_87;
+        break;
       case PARTY_LookUp:
         _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
         if ( _view_angle > 128 )
           _view_angle = 128;
         v35 = uActiveCharacter;
-        if ( !uActiveCharacter )
-          goto LABEL_87;
-        pPlayers[v35]->PlaySound((PlayerSpeech)SPEECH_63, 0);
+        if ( uActiveCharacter )
+          pPlayers[v35]->PlaySound((PlayerSpeech)SPEECH_63, 0);
         break;
       case PARTY_LookDown:
         _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
@@ -1873,7 +1833,7 @@
         }
         break;
       default:
-        goto LABEL_87;
+        break;
     }
   }
   v36 = 0;
@@ -12324,7 +12284,7 @@
   }
   else if ( v10 )
   {
-    sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[409], pMapInfo->pName);// "Do you wish to leave %s?"
+    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);
   }
@@ -12369,7 +12329,7 @@
   pTexture_outside = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("outside", TEXTURE_16BIT_PALETTE)];
   v1 = pMapStats->GetMapInfo(pCurrentMapName);
   if ( v1 )
-    sprintf(sHouseName, pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
+    sprintfex(sHouseName, 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);
@@ -12438,9 +12398,9 @@
       v6 = v3;
       v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s."
     }
-    sprintf(pTmpBuf, v5, v6, v1->pName);
+    sprintfex(pTmpBuf, v5, v6, v1->pName);
     strcat(pTmpBuf, "\n \n");
-    sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName);
+    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, 3u);
--- a/mm7_4.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/mm7_4.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -7154,7 +7154,7 @@
     v24 = pSkillNames[v17];
     v21 = pGlobalTXT_LocalizationStrings[225];
 LABEL_90:
-    sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[534], v21, v24, v27);
+    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534], v21, v24, v27);
   }
   return pTmpBuf2;
 }
@@ -7879,7 +7879,7 @@
   {
     pDialogueWindow->Release();
     pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
-    sprintf(sHouseName, pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName);
+    sprintfex(sHouseName, pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName);
     pBtn_ExitCancel = pDialogueWindow->CreateButton( 566, 445, 75, 33, 1, 0, 0x71u, 0, 0x4Eu,
                    pGlobalTXT_LocalizationStrings[34],// "Cancel"
                    (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),0);
--- a/mm7_5.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/mm7_5.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -2726,7 +2726,7 @@
             v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName;
             v157 = pGlobalTXT_LocalizationStrings[483];
 _sprintex_2args_draw_status_and_continue:
-            sprintf(pTmpBuf, v157, v173);
+            sprintfex(pTmpBuf, v157, v173);
           }
           else
           {
@@ -2756,7 +2756,7 @@
             v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
             v161 = pGlobalTXT_LocalizationStrings[486];
           }
-          sprintf(pTmpBuf, v161, v178);
+          sprintfex(pTmpBuf, v161, v178);
           sub_41C0B8_set_status_string(pTmpBuf);
           //goto LABEL_91;
           v0 = 1;
@@ -5108,7 +5108,7 @@
       v50 = (int)pMonster;
       pMonsterName = (char *)uDamageAmount;
       pPlayerName = player->pName;             // "%s inflicts %lu points killing %s"
-      sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[175], player->pName, uDamageAmount, pMonster);
+      sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[175], player->pName, uDamageAmount, pMonster);
       ShowStatusBarString(pTmpBuf, 2u);
     }
   }
--- a/mm7text_ru.cpp	Tue Mar 26 00:57:54 2013 +0400
+++ b/mm7text_ru.cpp	Tue Mar 26 00:58:16 2013 +0400
@@ -1328,16 +1328,16 @@
         switch (src[2])
         {
           case 'I': case 'i':
+          case 'V': case 'v':
+          case 'R': case 'r':
+          case 'D': case 'd':
+          case 'T': case 't':
           {
             strncpy(dst, name_begin, name_len);
             dst += name_len;
           }
           break;
 
-          case 'R': case 'r':
-          case 'D': case 'd':
-          case 'V': case 'v':
-          case 'T': case 't':
           case 'P': case 'p':
           {
             auto token_begin = src;