Skip to content

Commit

Permalink
avoid out stamina
Browse files Browse the repository at this point in the history
  • Loading branch information
jeannsebold6666 committed Aug 20, 2024
1 parent af50a9f commit 7f8dedb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
18 changes: 17 additions & 1 deletion src/ClassicUO.Client/Game/Data/StaticFilters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
using ClassicUO.Assets;
using ClassicUO.Renderer;
using ClassicUO.Utility;
using System.Drawing;

namespace ClassicUO.Game.Data
{
Expand Down Expand Up @@ -403,12 +404,27 @@ public static bool IsWallOfStone(ushort g)
return g == 0x038A;
}


[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsOutStamina()
{
return World.Player.StaminaMax == 0;
return World.Player.StaminaMax != World.Player.StaminaMax;
}
// ## BEGIN - END ## // MISC2
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool isHuman(ushort g)
{
return g >= 0x0190 && g <= 0x0193 || g >= 0x00B7 && g <= 0x00BA || g >= 0x025D && g <= 0x0260 || g == 0x029A || g == 0x029B || g == 0x02B6 || g == 0x02B7 || g == 0x03DB || g == 0x03DF || g == 0x03E2 || g == 0x02E8 || g == 0x02E9 || g == 0x04E5;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool isMonster(ushort g)
{
ANIMATION_GROUPS_TYPE type = AnimationsLoader.Instance.GetAnimType(g);

return type == ANIMATION_GROUPS_TYPE.MONSTER || type == ANIMATION_GROUPS_TYPE.ANIMAL || type == ANIMATION_GROUPS_TYPE.SEA_MONSTER;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsIgnoreCoT(ushort g)
{
Expand Down
6 changes: 3 additions & 3 deletions src/ClassicUO.Client/Game/GameObjects/Views/ItemView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ public override bool Draw(UltimaBatcher2D batcher, int posX, int posY, float dep
// ## BEGIN - END ## // ART / HUE CHANGES
// ## BEGIN - END ## // MISC

if (StaticFilters.IsOutStamina())
if (StaticFilters.IsOutStamina() && StaticFilters.isHuman(Graphic) || StaticFilters.IsOutStamina() && StaticFilters.isMonster(Graphic))
{
TileDataLoader.Instance.StaticData[Graphic].IsImpassable = false;
TileDataLoader.Instance.StaticData[Graphic].IsImpassable = true;
}
else
{
TileDataLoader.Instance.StaticData[Graphic].IsImpassable = true;
TileDataLoader.Instance.StaticData[Graphic].IsImpassable = false;
}

if (ProfileManager.CurrentProfile.BlockWoS)
Expand Down

0 comments on commit 7f8dedb

Please sign in to comment.