# HG changeset patch # User Ritor1 # Date 1386004762 -21600 # Node ID 87be06553c762b6cfb9fbd2237eae484be22420a # Parent 74f06d8a8017c6ab934e5ef9f3dafa3c468363d1 rename int _47F223_LooksLikeGenerateMonsterLoot() to void ArrangeSpriteObjects() diff -r 74f06d8a8017 -r 87be06553c76 Outdoor.cpp --- a/Outdoor.cpp Mon Dec 02 20:43:28 2013 +0600 +++ b/Outdoor.cpp Mon Dec 02 23:19:22 2013 +0600 @@ -2715,39 +2715,36 @@ // 6807E0: using guessed type int _6807E0_num_decorations_6807B8; //----- (0047F223) -------------------------------------------------------- -int OutdoorLocation::_47F223_LooksLikeGenerateMonsterLoot() +void OutdoorLocation::ArrangeSpriteObjects() { - signed int v1; // ebx@1 char *v2; // esi@2 - int v3; // eax@7 OutdoorLocation *v5; // [sp+0h] [bp-4h]@1 v5 = this; - v1 = 0; + if ( (signed int)uNumSpriteObjects > 0 ) { v2 = (char *)&pSpriteObjects[0].uObjectDescID; - do + for ( int i = 0; i < (signed int)uNumSpriteObjects; ++i ) { - if ( *(short *)v2 ) + if ( pSpriteObjects[i].uObjectDescID ) { - if ( !(v2[24] & 8) && !(pObjectList->pObjects[*(short *)v2].uFlags & 0x10) ) - *(int *)(v2 + 10) = GetTerrainHeightsAroundParty2(*(int *)(v2 + 2), *(int *)(v2 + 6), (int *)&v5, 0); - v3 = *(int *)(v2 + 34); - if ( v3 ) + if ( !(v2[24] & 8) && !(pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uFlags & 0x10) ) + pSpriteObjects[i].vPosition.z = GetTerrainHeightsAroundParty2(pSpriteObjects[i].vPosition.x, + pSpriteObjects[i].vPosition.y, (int *)&v5, 0); + if ( pSpriteObjects[i].stru_24.uItemID ) { - if ( v3 != 220 && pItemsTable->pItems[v3].uEquipType == 14 && !*(int *)(v2 + 38) ) - *(int *)(v2 + 38) = rand() % 15 + 5; - pItemsTable->SetSpecialBonus((ItemGen *)(v2 + 34)); + if ( pSpriteObjects[i].stru_24.uItemID != 220 + && pItemsTable->pItems[pSpriteObjects[i].stru_24.uItemID].uEquipType == EQUIP_POTION + && !pSpriteObjects[i].stru_24.uEnchantmentType ) + pSpriteObjects[i].stru_24.uEnchantmentType = rand() % 15 + 5; + pItemsTable->SetSpecialBonus(&pSpriteObjects[i].stru_24); } } - ++v1; v2 += 112; } - while ( v1 < (signed int)uNumSpriteObjects ); } pGameLoadingUI_ProgressBar->Progress(); - return 1; } //----- (0047F2D3) -------------------------------------------------------- diff -r 74f06d8a8017 -r 87be06553c76 Outdoor.h --- a/Outdoor.h Mon Dec 02 20:43:28 2013 +0600 +++ b/Outdoor.h Mon Dec 02 23:19:22 2013 +0600 @@ -147,7 +147,7 @@ bool _47F097(signed int a2, signed int a3); bool _47F0E2(); bool PrepareDecorations(); - int _47F223_LooksLikeGenerateMonsterLoot(); + void ArrangeSpriteObjects(); bool InitalizeActors(int a1); bool LoadRoadTileset(); bool LoadTileGroupIds(); diff -r 74f06d8a8017 -r 87be06553c76 mm7_3.cpp --- a/mm7_3.cpp Mon Dec 02 20:43:28 2013 +0600 +++ b/mm7_3.cpp Mon Dec 02 23:19:22 2013 +0600 @@ -3853,7 +3853,7 @@ RespawnGlobalDecorations(); } pOutdoor->PrepareDecorations(); - pOutdoor->_47F223_LooksLikeGenerateMonsterLoot(); + pOutdoor->ArrangeSpriteObjects(); pOutdoor->InitalizeActors(v2); pOutdoor->MessWithLUN(); v7 = strlen("levels\\"); diff -r 74f06d8a8017 -r 87be06553c76 mm7_4.cpp --- a/mm7_4.cpp Mon Dec 02 20:43:28 2013 +0600 +++ b/mm7_4.cpp Mon Dec 02 23:19:22 2013 +0600 @@ -931,7 +931,7 @@ if (!pPlayers[pBuf->uCaster]->CanAct()) { pBuf->Reset(); - if (dword_4EE07C[i] == 7 ) + if (dword_4EE07C[i] == PARTY_BUFF_FLY ) pParty->bFlying = false; } }