Fix condition flag > check, move to separate namespace

This commit is contained in:
Raymond 2021-08-10 08:56:33 -04:00
parent 174ae7b2df
commit 94645d8c7e
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
using System;
namespace Dalamud.Game.ClientState
namespace Dalamud.Game.ClientState.Conditions
{
/// <summary>
/// Provides access to conditions (generally player state). You can check whether a player is in combat, mounted, etc.
@ -37,7 +37,7 @@ namespace Dalamud.Game.ClientState
{
var idx = (int)flag;
if (idx > MaxConditionEntries || idx < 0)
if (idx < 0 || idx >= MaxConditionEntries)
return false;
return *(bool*)(this.ConditionArrayBase + idx);

View file

@ -1,4 +1,4 @@
namespace Dalamud.Game.ClientState
namespace Dalamud.Game.ClientState.Conditions
{
/// <summary>
/// Possible state flags (or conditions as they're called internally) that can be set on the local client.