fix: check if drawobject is null

This commit is contained in:
Anna 2024-02-17 22:41:33 -05:00
parent 34cbffb2b8
commit 4cf3258bdd
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 2 additions and 2 deletions

View File

@ -76,11 +76,11 @@ public class ScreenshotMetadata {
var visible = plugin.ObjectTable
.Where(obj => obj is PlayerCharacter)
.Cast<PlayerCharacter>()
// .Where(chara => plugin.GameGui.WorldToScreen(chara.Position, out _, out var inView) && inView)
.Where(chara => {
unsafe {
var obj = (GameObject*) chara.Address;
return obj->DrawObject->IsVisible;
var draw = obj->DrawObject;
return draw != null && draw->IsVisible;
}
})
.Select(chara => new Character(chara, scale, offsetX, offsetY))