Update relations when needed at broadcastCharInfo method.
Thanks to DebiaN.
This commit is contained in:
parent
7c4f31076d
commit
3be891c5e0
@ -4219,6 +4219,22 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
player.sendPacket(charInfo);
|
||||
}
|
||||
|
||||
// Update relation.
|
||||
final int relation = getRelation(player);
|
||||
final boolean isAutoAttackable = isAutoAttackable(player);
|
||||
final RelationCache oldrelation = getKnownRelations().get(player.getObjectId());
|
||||
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
|
||||
{
|
||||
final RelationChanged rc = new RelationChanged();
|
||||
rc.addRelation(this, relation, isAutoAttackable);
|
||||
if (hasSummon())
|
||||
{
|
||||
player.sendPacket(new RelationChanged(_summon, getRelation(player), isAutoAttackable(player)));
|
||||
}
|
||||
player.sendPacket(rc);
|
||||
getKnownRelations().put(player.getObjectId(), new RelationCache(relation, isAutoAttackable));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -4109,6 +4109,22 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
player.sendPacket(charInfo);
|
||||
}
|
||||
|
||||
// Update relation.
|
||||
final int relation = getRelation(player);
|
||||
final boolean isAutoAttackable = isAutoAttackable(player);
|
||||
final RelationCache oldrelation = getKnownRelations().get(player.getObjectId());
|
||||
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
|
||||
{
|
||||
final RelationChanged rc = new RelationChanged();
|
||||
rc.addRelation(this, relation, isAutoAttackable);
|
||||
if (hasSummon())
|
||||
{
|
||||
player.sendPacket(new RelationChanged(_summon, getRelation(player), isAutoAttackable(player)));
|
||||
}
|
||||
player.sendPacket(rc);
|
||||
getKnownRelations().put(player.getObjectId(), new RelationCache(relation, isAutoAttackable));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user