Mercurial > mm7
changeset 2021:b60eaf28bf0c
monster_info_distance_limit
author | Ritor1 |
---|---|
date | Mon, 11 Nov 2013 23:57:02 +0600 |
parents | b123afb8246b |
children | 03d9336e862f |
files | UI/UiGame.cpp mm7_2.cpp |
diffstat | 2 files changed, 11 insertions(+), 270 deletions(-) [+] |
line wrap: on
line diff
--- a/UI/UiGame.cpp Mon Nov 11 22:03:16 2013 +0600 +++ b/UI/UiGame.cpp Mon Nov 11 23:57:02 2013 +0600 @@ -1163,6 +1163,7 @@ unsigned int v45; // [sp+DCh] [bp-4h]@21 int interaction_distance_limit = 512; + int monster_info_distance_limit = 5120; pMouse->uPointingObjectID = 0; pMouse->GetClickPos(&pX, &pY); @@ -1209,22 +1210,13 @@ uLastPointedObjectID = 0; return; } - if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) + if ( HIWORD(v18) < interaction_distance_limit && !pParty->pPickedItem.uItemID ) { - GameUI_SetFooterString(pSpriteObjects[v19].stru_24.GetDisplayName()); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pFooterString[0] = 0; - bForceDrawFooter = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; + sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[470], pSpriteObjects[v19].stru_24.GetDisplayName());// "Get %s" + GameUI_SetFooterString(pTmpBuf.data()); return; } - sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[470], pSpriteObjects[v19].stru_24.GetDisplayName());// "Get %s" - GameUI_SetFooterString(pTmpBuf.data()); + GameUI_SetFooterString(pSpriteObjects[v19].stru_24.GetDisplayName()); if ( pMouse->uPointingObjectID == 0 ) { if ( uLastPointedObjectID != 0 ) @@ -1246,31 +1238,12 @@ else pText = pDecorationList->pDecorations[pLevelDecorations[v19].uDecorationDescID].field_20; GameUI_SetFooterString(pText); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pFooterString[0] = 0; - bForceDrawFooter = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; } - if ( !GetEventHintString(pLevelDecorations[v19].uEventID) ) + else { - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pFooterString[0] = 0; - bForceDrawFooter = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; + if ( GetEventHintString(pLevelDecorations[v19].uEventID) ) + GameUI_SetFooterString(GetEventHintString(pLevelDecorations[v19].uEventID)); } - GameUI_SetFooterString(GetEventHintString(pLevelDecorations[v19].uEventID)); if ( pMouse->uPointingObjectID == 0 ) { if ( uLastPointedObjectID != 0 ) @@ -1342,41 +1315,15 @@ uLastPointedObjectID = 0; return; } - else + if (PID_TYPE(v18) == OBJECT_Actor && HIWORD(v18) < monster_info_distance_limit ) { - if (PID_TYPE(v18) != OBJECT_Actor) - { - pMouse->uPointingObjectID = 0; - if ( uLastPointedObjectID != 0 ) - { - pFooterString[0] = 0; - bForceDrawFooter = 1; - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( v18 >= 335544320 ) - { - pMouse->uPointingObjectID = 0; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pFooterString[0] = 0; - bForceDrawFooter = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - v28 = pTmpBuf.data(); if ( pActors[v19].dword_000334_unique_name ) pText = pMonsterStats->pPlaceStrings[pActors[v19].dword_000334_unique_name]; else pText = pMonsterStats->pInfos[pActors[v19].pMonsterInfo.uID].pName; - strncpy(pTmpBuf.data(), pText, 0x7D0u); + strncpy(pTmpBuf.data(), pText, 2000); + GameUI_SetFooterString(pTmpBuf.data()); } - GameUI_SetFooterString(v28); if ( pMouse->uPointingObjectID == 0 ) { if ( uLastPointedObjectID != 0 )
--- a/mm7_2.cpp Mon Nov 11 22:03:16 2013 +0600 +++ b/mm7_2.cpp Mon Nov 11 23:57:02 2013 +0600 @@ -4966,212 +4966,6 @@ return v19; } -//----- (0046A99B) -------------------------------------------------------- -int sub_46A99B() -{ - int v0; // ebx@1 - signed int v1; // ecx@1 - signed int v2; // esi@1 - int v3; // edx@1 - signed int v4; // eax@1 - int v5; // ecx@2 - int *v6; // eax@3 - int v7; // ecx@3 - int v8; // edx@5 - int v9; // edi@6 - unsigned __int8 v10; // zf@14 - char v11; // sf@14 - char v12; // of@14 - int *v14; // esi@19 - signed int v15; // ebx@19 - int i; // edi@20 - int v17; // ecx@21 - int v18; // edi@26 - int v19; // esi@27 - unsigned int v20; // ecx@27 - BLVFace *v21; // eax@32 - unsigned int v22; // ecx@33 - const char *v23; // eax@35 - const char *v24; // ecx@36 - LevelDecoration *v25; // ecx@43 - LevelDecoration *v26; // edi@43 - __int16 v27; // ax@43 - int v28; // [sp+Ch] [bp-18h]@1 - int v29; // [sp+14h] [bp-10h]@2 - int v30; // [sp+18h] [bp-Ch]@1 - signed int v31; // [sp+1Ch] [bp-8h]@3 - int v32; // [sp+20h] [bp-4h]@1 - - v0 = 0; - v1 = (signed int)(viewparams->uScreen_BttmR_Y + viewparams->uScreen_topL_Y) >> 1; - v2 = (signed int)(viewparams->uScreen_topL_X + viewparams->uScreen_BttmR_X) >> 1; - v3 = v1 - 50; - v32 = 0; - v4 = 100; - v30 = v1 - 50; - v28 = v1 + 50; - if ( v1 - 50 >= v1 + 50 ) - return 0; - v5 = 640 * v3; - v29 = 640 * v3; - while ( 2 ) - { - v6 = &pRenderer->pActiveZBuffer[v2 + v5 - v4 / 2]-1; - v7 = v0; - //while ( 1 ) - for( int i = 0; i < 100; i++) - { - ++v6; - v8 = *v6; - if ( (unsigned int)*v6 <= 0x2000000 ) - { - v9 = 0; - if ( v7 > 0 ) - { - do - { - if ( dword_7201B0_zvalues[v9] == (unsigned __int16)v8 ) - break; - ++v9; - } - while ( v9 < v0 ); - } - if ( v9 == v0 ) - { - if ( v8 & 7 ) - { - dword_720020_zvalues[v7] = v8; - dword_7201B0_zvalues[v7] = (unsigned __int16)v8; - ++v7; - ++v0; - v32 = v0; - if ( v7 == 99 ) - { - v12 = 0; - v10 = v0 == 0; - v11 = v0 < 0; - goto LABEL_18; - } - } - } - } - } - v4 = -1; - ++v30; - v5 = v29 + 640; - v29 += 640; - if ( v30 >= v28 ) - break; - } - v12 = 0; - v10 = v0 == 0; - v11 = v0 < 0; - if ( !v0 ) - return 0; -LABEL_18: - if ( !((unsigned __int8)(v11 ^ v12) | v10) ) - { - v14 = dword_720020_zvalues.data(); - v15 = 1; - do - { - for ( i = v15; i < v32; ++i ) - { - v17 = dword_720020_zvalues[i]; - if ( v17 < *v14 ) - { - dword_720020_zvalues[i] = *v14; - *v14 = v17; - } - } - ++v15; - ++v14; - } - while ( v15 - 1 < v32 ); - v0 = v32; - } - v18 = 0; - if ( v0 <= 0 ) - return 0; - while ( 1 ) - { - v19 = dword_720020_zvalues[v18] & 0xFFFF; - v20 = PID_ID(dword_720020_zvalues[v18]); - if ( PID_TYPE(dword_720020_zvalues[v18]) == OBJECT_Item) - { - if ( v20 >= 0x3E8 ) - return 0; - if ( !(pSpriteObjects[v20].uAttributes & 0x10) ) - { - v23 = pSpriteObjects[v20].stru_24.GetDisplayName(); - v24 = v23; - GameUI_SetFooterString(v24); - return v19; - } - } - else - { - if ( PID_TYPE(dword_720020_zvalues[v18]) == OBJECT_Actor) - { - if ( v20 >= 0xBB8 ) - return 0; - v24 = (const char *)&pActors[v20]; - GameUI_SetFooterString(v24); - return v19; - } - if ( PID_TYPE(dword_720020_zvalues[v18]) == OBJECT_Decoration) - break; - if ( PID_TYPE(dword_720020_zvalues[v18]) == OBJECT_BModel) - { - if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) - { - v21 = &pIndoor->pFaces[v20]; - if ( BYTE3(v21->uAttributes) & 2 ) - v22 = pIndoor->pFaceExtras[v21->uFaceExtraID].uEventID; - } - else - { - if ( (dword_720020_zvalues[v18] & 0xFFFFu) >> 9 < pOutdoor->uNumBModels ) - { - v22 = pOutdoor->pBModels[(dword_720020_zvalues[v18] & 0xFFFFu) >> 9].pFaces[v20 & 0x3F].sCogTriggeredID; - if ( v22 ) - { - v23 = GetEventHintString(v22); - if ( v23 ) - { - v24 = v23; - GameUI_SetFooterString(v24); - return v19; - } - } - } - } - } - } - ++v18; - if ( v18 >= v0 ) - return 0; - } - v25 = &pLevelDecorations[v20]; - v26 = v25; - v27 = pLevelDecorations[v20].uEventID; - if ( v27 ) - { - v23 = GetEventHintString(v27); - if ( !v23 ) - return v19; - v24 = v23; - GameUI_SetFooterString(v24); - return v19; - } - if ( v25->IsInteractive() ) - v24 = pNPCTopics[stru_5E4C90_MapPersistVars._decor_events[v26->_idx_in_stru123 - 75] + 379].pTopic; - else - v24 = pDecorationList->pDecorations[v26->uDecorationDescID].field_20; - GameUI_SetFooterString(v24); - return v19; -} - //----- (0046BDA8) -------------------------------------------------------- unsigned int GetGravityStrength() {