Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jeannsebold6666 committed Apr 5, 2024
1 parent 3c0acf7 commit 357aeba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/ClassicUO.Client/Game/GameObjects/Views/MobileView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public override bool Draw(UltimaBatcher2D batcher, int posX, int posY, float dep

// ## BEGIN - END ## // VISUAL HELPERS

if (ProfileManager.CurrentProfile.HighlighFriendsGuildType != 0 && World.Get(this.Serial) != null)
if (ProfileManager.CurrentProfile.HighlighFriendsGuildType != 0)
{
overridedHue = CombatCollection.LastFriendHue(this, overridedHue);
hueVec.Y = 1;
Expand Down
21 changes: 9 additions & 12 deletions src/ClassicUO.Client/Game/UI/Gumps/HealthBarGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ protected BaseHealthBarGump(Entity entity) : this(0, 0)
CanCloseWithRightClick = true;
_name = entity.Name;
_isDead = entity is Mobile mm && mm.IsDead;
_serial = entity.Serial;
// ## BEGIN - END ## // MISC
LocalEntity = entity;
// ## BEGIN - END ## // MISC
Expand Down Expand Up @@ -125,7 +124,6 @@ protected set { }
protected bool _canChangeName;
protected bool _isDead;
protected string _name;
protected uint _serial;
protected bool _outOfRange;
protected StbTextBox _textBox;
// ## BEGIN - END ## // OUTLANDS
Expand Down Expand Up @@ -296,24 +294,24 @@ protected override void OnMouseDown(int x, int y, MouseButtonType button)
Entity ent = World.Get(LocalSerial);
if (ent == null && LocalSerial != World.Player.Serial)
{
if (_serial != null)
if (LocalSerial != null)
{

GameActions.Print(World.Player, $"Target OutRange: {_name}");
TargetManager.LastTargetInfo.Serial = _serial;
TargetManager.TargetFromHealthBar(_serial);
TargetManager.LastTargetInfo.Serial = LocalSerial;
TargetManager.TargetFromHealthBar(LocalSerial);

}
else
{

Entity cachedEntity;
if (entityCache.TryGetValue(_serial, out cachedEntity))
if (entityCache.TryGetValue(LocalSerial, out cachedEntity))
{

GameActions.Print(World.Player, $"Target OutRange : {cachedEntity.Name}");
TargetManager.LastTargetInfo.Serial = cachedEntity.Serial;
TargetManager.TargetFromHealthBar(_serial);
TargetManager.TargetFromHealthBar(cachedEntity.Serial);

}
else
Expand Down Expand Up @@ -655,8 +653,7 @@ public override void Update()
if (!string.IsNullOrEmpty(entity.Name) && _name != entity.Name)
{
_name = entity.Name;
_serial = entity.Serial;


if (_textBox != null)
{
_textBox.SetText(_name);
Expand Down Expand Up @@ -2094,10 +2091,10 @@ public override void Update()
_isDead = false;
}

if (!string.IsNullOrEmpty(entity.Name) && !(inparty && LocalSerial == World.Player.Serial) && _name != entity.Name)
if (!string.IsNullOrEmpty(entity.Name) && !(inparty && LocalSerial == World.Player.Serial) && _name != entity.Name )
{
_name = entity.Name;
_serial = entity.Serial;


if (_textBox != null)
{
Expand Down Expand Up @@ -2154,7 +2151,7 @@ public override void Update()
_outOfRange = false;

_canChangeName = !inparty && mobile != null && mobile.IsRenamable;

//_serial = entity.Serial;
hitsColor = 0;

if (inparty)
Expand Down

0 comments on commit 357aeba

Please sign in to comment.