Mercurial > mm7
comparison mm7_4.cpp @ 1419:9a1adf08f4ed
more label cleaning 2
author | zipi |
---|---|
date | Sun, 28 Jul 2013 18:54:40 +0100 |
parents | 3881d2f94eb1 |
children | 5930342f092b |
comparison
equal
deleted
inserted
replaced
1418:483b1b453986 | 1419:9a1adf08f4ed |
---|---|
387 return dword_720F20[0]; | 387 return dword_720F20[0]; |
388 } | 388 } |
389 } | 389 } |
390 v22 = 0; | 390 v22 = 0; |
391 v38 = v5; | 391 v38 = v5; |
392 if ( v39 <= (signed int)v5 ) | 392 if ( v39 > (signed int)v5 ) |
393 goto LABEL_54; | 393 { |
394 v23 = 0; | 394 v23 = 0; |
395 do | 395 do |
396 { | 396 { |
397 v24 = dword_720F20[v5 / 4]; | 397 v24 = dword_720F20[v5 / 4]; |
398 v25 = *(int *)((char *)dword_720F20.data() + v23); | 398 v25 = *(int *)((char *)dword_720F20.data() + v23); |
399 if ( v24 == v25 ) | 399 if ( v24 == v25 ) |
400 goto LABEL_50; | 400 { |
401 if ( v25 > a3 + 15 ) | 401 v22 = v38; |
402 { | 402 v23 = v5; |
403 if ( v24 >= v25 ) | 403 } |
404 goto LABEL_51; | 404 else if ( v25 > a3 + 15 ) |
405 LABEL_50: | 405 { |
406 v22 = v38; | 406 if ( v24 < v25 ) |
407 v23 = v5; | 407 { |
408 goto LABEL_51; | 408 v22 = v38; |
409 } | 409 v23 = v5; |
410 if ( v24 > v25 && v24 <= a3 + 15 ) | 410 } |
411 goto LABEL_50; | 411 } |
412 LABEL_51: | 412 else if ( v24 > v25 && v24 <= a3 + 15 ) |
413 ++v38; | 413 { |
414 v5 += 4; | 414 v22 = v38; |
415 } | 415 v23 = v5; |
416 while ( v38 < v39 ); | 416 } |
417 if ( v22 ) | 417 ++v38; |
418 { | 418 v5 += 4; |
419 *(int *)a4 = dword_720E80[v22] | (dword_720ED0[v22] << 6); | 419 } |
420 return dword_720F20[v22]; | 420 while ( v38 < v39 ); |
421 } | 421 if ( v22 ) |
422 LABEL_54: | 422 { |
423 *(int *)a4 = dword_720E80[v22] | (dword_720ED0[v22] << 6); | |
424 return dword_720F20[v22]; | |
425 } | |
426 } | |
423 *(int *)a4 = 0; | 427 *(int *)a4 = 0; |
424 return dword_720F20[v22]; | 428 return dword_720F20[v22]; |
425 } | 429 } |
426 | 430 |
427 //----- (0046DEF2) -------------------------------------------------------- | 431 //----- (0046DEF2) -------------------------------------------------------- |
1229 if ( pPlayers[v12]->WearsItem(ITEM_RELIC_HARECS_LEATHER, EQUIP_ARMOUR) | 1233 if ( pPlayers[v12]->WearsItem(ITEM_RELIC_HARECS_LEATHER, EQUIP_ARMOUR) |
1230 || pPlayers[v12]->HasEnchantedItemEquipped(71) | 1234 || pPlayers[v12]->HasEnchantedItemEquipped(71) |
1231 || pPlayers[v12]->pPlayerBuffs[23].uExpireTime > 0 ) | 1235 || pPlayers[v12]->pPlayerBuffs[23].uExpireTime > 0 ) |
1232 { | 1236 { |
1233 v58 = 0; | 1237 v58 = 0; |
1238 v13->PlayEmotion(CHARACTER_EXPRESSION_37, v58); | |
1234 } | 1239 } |
1235 else | 1240 else |
1236 { | 1241 { |
1237 v58 = 0; | 1242 v58 = 0; |
1238 if ( !sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v12) ) | 1243 if ( !sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v12) ) |
1243 if ( pParty->uFlags & 4 ) | 1248 if ( pParty->uFlags & 4 ) |
1244 { | 1249 { |
1245 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[660]); | 1250 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[660]); |
1246 GameUI_Footer_TimeLeft = 128; | 1251 GameUI_Footer_TimeLeft = 128; |
1247 } | 1252 } |
1248 goto LABEL_39; | 1253 } |
1249 } | 1254 else |
1250 v13 = pPlayers[v12]; | 1255 { |
1251 } | 1256 v13 = pPlayers[v12]; |
1252 v13->PlayEmotion(CHARACTER_EXPRESSION_37, v58); | 1257 v13->PlayEmotion(CHARACTER_EXPRESSION_37, v58); |
1253 LABEL_39: | 1258 } |
1259 } | |
1254 ++v12; | 1260 ++v12; |
1255 if ( v12 > 4 ) | 1261 if ( v12 > 4 ) |
1256 { | 1262 { |
1257 v11 = LODWORD(pParty->uTimePlayed); | 1263 v11 = LODWORD(pParty->uTimePlayed); |
1258 break; | 1264 break; |
1297 v21->Recover(a2a); | 1303 v21->Recover(a2a); |
1298 v22 = v21->sHealth; | 1304 v22 = v21->sHealth; |
1299 if ( v21->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) + v22 + v21->uEndurance >= 1 | 1305 if ( v21->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) + v22 + v21->uEndurance >= 1 |
1300 || (signed __int64)v21->pPlayerBuffs[11].uExpireTime > 0 ) | 1306 || (signed __int64)v21->pPlayerBuffs[11].uExpireTime > 0 ) |
1301 { | 1307 { |
1302 if ( v22 >= 1 ) | 1308 if ( v22 < 1 ) |
1303 goto LABEL_59; | 1309 { |
1304 v59 = 0; | 1310 v59 = 0; |
1305 v56 = 13; | 1311 v56 = 13; |
1312 v21->SetCondition(v56, v59); | |
1313 } | |
1306 } | 1314 } |
1307 else | 1315 else |
1308 { | 1316 { |
1309 v59 = 0; | 1317 v59 = 0; |
1310 v56 = 14; | 1318 v56 = 14; |
1311 } | 1319 v21->SetCondition(v56, v59); |
1312 v21->SetCondition(v56, v59); | 1320 } |
1313 LABEL_59: | |
1314 v23 = (int)&v21->field_E0; | 1321 v23 = (int)&v21->field_E0; |
1315 if ( v21->field_E0 ) | 1322 if ( v21->field_E0 ) |
1316 { | 1323 { |
1317 v24 = *(int *)v23 - pEventTimer->uTimeElapsed; | 1324 v24 = *(int *)v23 - pEventTimer->uTimeElapsed; |
1318 if ( v24 > 0 ) | 1325 if ( v24 > 0 ) |
1596 | 1603 |
1597 _uNumFrames = this->uNumFrames; | 1604 _uNumFrames = this->uNumFrames; |
1598 result = 0; | 1605 result = 0; |
1599 if ( (signed int)this->uNumFrames <= 0 ) | 1606 if ( (signed int)this->uNumFrames <= 0 ) |
1600 { | 1607 { |
1601 LABEL_5: | |
1602 result = 0; | 1608 result = 0; |
1603 } | 1609 } |
1604 else | 1610 else |
1605 { | 1611 { |
1606 v4 = this->pFrames; | 1612 v4 = this->pFrames; |
1607 while ( v4->expression != expression ) | 1613 while ( v4->expression != expression ) |
1608 { | 1614 { |
1609 ++result; | 1615 ++result; |
1610 ++v4; | 1616 ++v4; |
1611 if ( (signed int)result >= (signed int)_uNumFrames ) | 1617 if ( (signed int)result >= (signed int)_uNumFrames ) |
1612 goto LABEL_5; | 1618 return 0; |
1613 } | 1619 } |
1614 } | 1620 } |
1615 return result; | 1621 return result; |
1616 } | 1622 } |
1617 | 1623 |
1849 { | 1855 { |
1850 v4 = a2; | 1856 v4 = a2; |
1851 dword_AE336C = a1; | 1857 dword_AE336C = a1; |
1852 v10 = 0; | 1858 v10 = 0; |
1853 if ( (signed int)pNPCStats->uNumNPCNames[v4] <= 0 ) | 1859 if ( (signed int)pNPCStats->uNumNPCNames[v4] <= 0 ) |
1854 goto LABEL_17; | 1860 { |
1861 v3 = rand() % (signed int)pNPCStats->uNumNPCNames[v4]; | |
1862 } | |
1863 else | |
1864 { | |
1855 v9 = (int **)((char *)pNPCStats->pNPCNames + v4 * 4); | 1865 v9 = (int **)((char *)pNPCStats->pNPCNames + v4 * 4); |
1856 do | 1866 do |
1857 { | 1867 { |
1858 v5 = tolower(*(char *)*v9); | 1868 v5 = tolower(*(char *)*v9); |
1859 if ( v5 == tolower(v2) ) | 1869 if ( v5 == tolower(v2) ) |
1868 } | 1878 } |
1869 while ( v10 < (signed int)pNPCStats->uNumNPCNames[v4] ); | 1879 while ( v10 < (signed int)pNPCStats->uNumNPCNames[v4] ); |
1870 if ( v8 && v8 != v7 ) | 1880 if ( v8 && v8 != v7 ) |
1871 v3 = v8 + rand() % (v7 - v8); | 1881 v3 = v8 + rand() % (v7 - v8); |
1872 else | 1882 else |
1873 LABEL_17: | |
1874 v3 = rand() % (signed int)pNPCStats->uNumNPCNames[v4]; | 1883 v3 = rand() % (signed int)pNPCStats->uNumNPCNames[v4]; |
1884 } | |
1875 } | 1885 } |
1876 dword_AE3370 = v3; | 1886 dword_AE3370 = v3; |
1877 return pNPCStats->pNPCNames[0][v11 + 2 * v3]; | 1887 return pNPCStats->pNPCNames[0][v11 + 2 * v3]; |
1878 } | 1888 } |
1879 // AE336C: using guessed type int dword_AE336C; | 1889 // AE336C: using guessed type int dword_AE336C; |
2091 else | 2101 else |
2092 v11 = pGlobalTXT_LocalizationStrings[388];// "Lord" | 2102 v11 = pGlobalTXT_LocalizationStrings[388];// "Lord" |
2093 goto _continue_strcat; | 2103 goto _continue_strcat; |
2094 case 11: | 2104 case 11: |
2095 v25 = GetPartyReputation(); | 2105 v25 = GetPartyReputation(); |
2096 goto LABEL_46; | 2106 if ( v25 >= 25 ) |
2107 { | |
2108 v11 = pGlobalTXT_LocalizationStrings[379]; | |
2109 } | |
2110 else | |
2111 { | |
2112 if ( v25 < 6 ) | |
2113 { | |
2114 if ( v25 >= -5 ) | |
2115 { | |
2116 v11 = pGlobalTXT_LocalizationStrings[399]; | |
2117 } | |
2118 else | |
2119 { | |
2120 if ( v25 < -24 ) | |
2121 v11 = pGlobalTXT_LocalizationStrings[434]; | |
2122 else | |
2123 v11 = pGlobalTXT_LocalizationStrings[402]; | |
2124 } | |
2125 } | |
2126 else | |
2127 { | |
2128 v11 = pGlobalTXT_LocalizationStrings[392]; | |
2129 } | |
2130 } | |
2131 goto _continue_strcat; | |
2097 case 12: | 2132 case 12: |
2098 v25 = npc->rep; | 2133 v25 = npc->rep; |
2099 LABEL_46: | |
2100 if ( v25 >= 25 ) | 2134 if ( v25 >= 25 ) |
2101 { | 2135 { |
2102 v11 = pGlobalTXT_LocalizationStrings[379]; | 2136 v11 = pGlobalTXT_LocalizationStrings[379]; |
2103 } | 2137 } |
2104 else | 2138 else |