mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-23 00:49:17 +01:00
fix: move InvalidGameObjectId check into SearchById
This commit is contained in:
parent
ed1a6c7810
commit
8feb0a9c53
2 changed files with 4 additions and 2 deletions
|
|
@ -7,7 +7,6 @@ using Dalamud.Game.ClientState.Objects.SubKinds;
|
|||
using Dalamud.Game.ClientState.Objects.Types;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.IoC.Internal;
|
||||
using JetBrains.Annotations;
|
||||
using Serilog;
|
||||
|
||||
namespace Dalamud.Game.ClientState.Objects
|
||||
|
|
@ -65,6 +64,9 @@ namespace Dalamud.Game.ClientState.Objects
|
|||
/// <returns>A game object or null.</returns>
|
||||
public GameObject? SearchById(uint objectId)
|
||||
{
|
||||
if (objectId is GameObject.InvalidGameObjectId or 0)
|
||||
return null;
|
||||
|
||||
foreach (var obj in this)
|
||||
{
|
||||
if (obj == null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue