Do not allow cross-planet launch pads
This commit is contained in:
@@ -163,7 +163,7 @@ public class Universe{
|
|||||||
//export to another sector
|
//export to another sector
|
||||||
if(sector.info.destination != null){
|
if(sector.info.destination != null){
|
||||||
Sector to = sector.info.destination;
|
Sector to = sector.info.destination;
|
||||||
if(to.hasBase()){
|
if(to.hasBase() && to.planet == planet){
|
||||||
ItemSeq items = new ItemSeq();
|
ItemSeq items = new ItemSeq();
|
||||||
//calculated exported items to this sector
|
//calculated exported items to this sector
|
||||||
sector.info.export.each((item, stat) -> items.add(item, (int)(stat.mean * newSecondsPassed * sector.getProductionScale())));
|
sector.info.export.each((item, stat) -> items.add(item, (int)(stat.mean * newSecondsPassed * sector.getProductionScale())));
|
||||||
|
|||||||
@@ -621,6 +621,7 @@ public class Block extends UnlockableContent implements Senseable{
|
|||||||
|
|
||||||
public boolean canReplace(Block other){
|
public boolean canReplace(Block other){
|
||||||
if(other.alwaysReplace) return true;
|
if(other.alwaysReplace) return true;
|
||||||
|
if(other.privileged) return false;
|
||||||
return other.replaceable && (other != this || (rotate && quickRotate)) && this.group != BlockGroup.none && other.group == this.group &&
|
return other.replaceable && (other != this || (rotate && quickRotate)) && this.group != BlockGroup.none && other.group == this.group &&
|
||||||
(size == other.size || (size >= other.size && ((subclass != null && subclass == other.subclass) || group.anyReplace)));
|
(size == other.size || (size >= other.size && ((subclass != null && subclass == other.subclass) || group.anyReplace)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class LaunchPad extends Block{
|
|||||||
|
|
||||||
table.button(Icon.upOpen, Styles.cleari, () -> {
|
table.button(Icon.upOpen, Styles.cleari, () -> {
|
||||||
ui.planet.showSelect(state.rules.sector, other -> {
|
ui.planet.showSelect(state.rules.sector, other -> {
|
||||||
if(state.isCampaign()){
|
if(state.isCampaign() && other.planet == state.rules.sector.planet){
|
||||||
state.rules.sector.info.destination = other;
|
state.rules.sector.info.destination = other;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user