What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

WiN

Member
Joined
Sep 2, 2014
Messages
294
I am trying to update the Summon Spectre routine to be a bit more specific - i.e. target only certain mobs, not just anything in range. I have tried messing with using target.Name in the where, but it doesn't like that - any advise on how to go about this in a better way?

private Monster BestDeadTarget
{
get
{
var myPos = LokiPoe.Me.Position;
return LokiPoe.ObjectManager.GetObjectsByType<Monster>()
.Where(
m =>
// m.Distance < 30 && m.IsActiveDead && target.Name == "Stygian Revenant" && m.CorpseUsable &&
m.Distance < 30 && m.IsActiveDead && m.Rarity != Rarity.Unique && m.CorpseUsable &&
 
1) It's not the whole code.
2) Use FirstOrDefault instead of Where.

Yep, so you can nullcheck it afterwards. FoD() returns either an object or null.

also, your linq reference is "m" and you use "target.Name", should be "m.Name"
 
Back
Top