mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-03-10 07:14:27 +00:00
remove shouldreceive thing so force ownership works
This commit is contained in:
parent
5129c84430
commit
7be7bef4ad
@ -33,6 +33,7 @@ public abstract class OwnedWorldObject<T> : WorldObject<T>, IOwnedWorldObject
|
||||
}
|
||||
if (Owner == player.PlayerId)
|
||||
{
|
||||
// put CanOwn check here cuz it only does the thingy in OnReceiveRemote and we want to be able to own this
|
||||
((IOwnedWorldObject)this).SendMessage(new OwnedWorldObjectMessage(CanOwn ? QSBPlayerManager.LocalPlayerId : 0));
|
||||
}
|
||||
}
|
||||
|
@ -10,28 +10,6 @@ public class OwnedWorldObjectMessage : QSBWorldObjectMessage<IOwnedWorldObject,
|
||||
{
|
||||
public OwnedWorldObjectMessage(uint owner) : base(owner) { }
|
||||
|
||||
public override bool ShouldReceive
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!base.ShouldReceive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Deciding if to change the object's owner
|
||||
// Message
|
||||
// | = 0 | > 0 |
|
||||
// = 0 | No | Yes |
|
||||
// > 0 | Yes | No |
|
||||
// if Obj==Message then No
|
||||
// Obj
|
||||
|
||||
// ie if no owner, or we're trying to release ownership, and we're actually changing who the owner is
|
||||
return (WorldObject.Owner == 0 || Data == 0) && WorldObject.Owner != Data;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnReceiveLocal() => WorldObject.Owner = Data;
|
||||
|
||||
public override void OnReceiveRemote()
|
||||
|
Loading…
x
Reference in New Issue
Block a user