Make players assume ownership of networks when they place security stations onto unsecured ones (#4714)

* Fixes #4712: When a security station is placed onto an unsecured network, the placer assumes ownership of the entire network. Otherwise the contiguous network would not necessarily reconnect in the same way when the chunk is reloaded due to differing player-ids throughout the network.
In addition, changes to the node's owner were not being persisted due to the host never being marked as dirty.

* Fix formatting
This commit is contained in:
shartte
2020-09-10 22:34:16 +02:00
committed by GitHub
parent 81cc0b804d
commit 65f58913a4
6 changed files with 31 additions and 5 deletions
@@ -167,7 +167,6 @@ public class AENetworkProxy implements IGridBlock {
* short cut!
*
* @return grid of node
*
* @throws GridAccessException of node or grid is null
*/
public IGrid getGrid() throws GridAccessException {
@@ -280,6 +279,11 @@ public class AENetworkProxy implements IGridBlock {
@Override
public void onGridNotification(final GridNotification notification) {
if (notification == GridNotification.OWNER_CHANGED) {
gp.saveChanges();
return;
}
if (this.gp instanceof CablePart) {
((CablePart) this.gp).markForUpdate();
}