Skip to content

Commit

Permalink
Fix clicking NPCs that don't have a sprite with visible pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed May 1, 2023
1 parent deac6f3 commit 2992431
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions EndlessClient/Rendering/NPC/NPCRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
using Microsoft.Xna.Framework.Graphics;
using Optional;
using System;
using System.Linq;
using System.Windows.Markup;
using XNAControls;

namespace EndlessClient.Rendering.NPC
Expand Down Expand Up @@ -129,6 +131,11 @@ public override void Initialize()

_spriteBatch = new SpriteBatch(Game.GraphicsDevice);

var frameTexture = _npcSpriteSheet.GetNPCTexture(_enfFileProvider.ENFFile[NPC.ID].Graphic, NPC.Frame, NPC.Direction);
var data = new Color[frameTexture.Width * frameTexture.Height];
frameTexture.GetData(data);
_isBlankSprite = data.All(x => x.A == 0);

base.Initialize();
}

Expand Down

0 comments on commit 2992431

Please sign in to comment.