im getting a "system.nullreferenceexception: object reference not set to an instance of an object." at this line:
and heres the reference:
it seems like this is getting thrown when my summoned guard dies?
Code:
var Pet = Server.GamePoll.Values.Where(p => p.Pet != null && p.Pet?.monster.UID == aUID).FirstOrDefault();
Code:
public void Dead(ServerSockets.Packet stream, GameClient killer, uint aUID, Role.GameMap GameMap, bool CounterKill = false)
{
if (Alive)
{
DropStats.AllMonstersInServer--;
if (IsFloor)
{
FloorPacket.DropType = MsgDropID.RemoveEffect;
HitPoints = 0;
GameMap.SetMonsterOnTile(X, Y, false);
return;
}
RespawnStamp = Time32.Now.AddSeconds(8 + Family.RespawnTime);
ClearFlags(false);
HitPoints = 0;
AddFlag(MsgUpdate.Flags.Dead, Role.StatusFlagsBigVector32.PermanentFlag, true);
DeadStamp = Time32.Now;
var Pet = Server.GamePoll.Values.Where(p => p.Pet != null && p.Pet?.monster.UID == aUID).FirstOrDefault();
if (Pet != null)
Pet?.Pet.DeAtach(stream);
InteractQuery action = new InteractQuery()
{
UID = aUID,
KilledMonster = true,
X = X,
Y = Y,
AtkType = MsgAttackPacket.AttackID.Death,
OpponentUID = UID
};