diff UI/UiGame.cpp @ 2021:b60eaf28bf0c

monster_info_distance_limit
author Ritor1
date Mon, 11 Nov 2013 23:57:02 +0600
parents b123afb8246b
children 23ef3589440f
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 )