mirror of
https://bitbucket.org/projectswg/cucore.git
synced 2026-07-13 20:00:58 -04:00
Fixed lots of issues caused by child objects not sending packets to those aware of their parent object
This commit is contained in:
@@ -251,7 +251,13 @@ public class SWGObject implements Serializable, Comparable<SWGObject> {
|
||||
}
|
||||
|
||||
public Player getOwner() {
|
||||
return owner;
|
||||
if (owner != null)
|
||||
return owner;
|
||||
|
||||
if (getParent() != null)
|
||||
return getParent().getOwner(); // Ziggy: Player owner is found recursively
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public SWGObject getParent() {
|
||||
@@ -376,10 +382,17 @@ public class SWGObject implements Serializable, Comparable<SWGObject> {
|
||||
continue;
|
||||
p.sendPacket(packets);
|
||||
}
|
||||
|
||||
SWGObject parent = getParent();
|
||||
|
||||
if(parent != null)
|
||||
parent.sendObservers(packets);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void sendSelf(Packet ... packets) {
|
||||
Player owner = getOwner();
|
||||
if (owner != null)
|
||||
owner.sendPacket(packets);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user