Skip to content

Commit

Permalink
1.6.5.1 Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuria-Shikibe committed Feb 23, 2021
1 parent 21732f2 commit 8098ab2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mod.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ displayName: "NewHorizonMod"
author: "Yuria"
main: "newhorizon.NewHorizon"
description: "Expanded contents, including Units, Turrets, Blocks, etc.\n\n [accent]This mod adds a new setting dialog when start the game.[] [gray]By choose the available setting, you can activate in-game debug panel and advance load, which creates outline icons and unit full icons automatically. However, the advance load now causes stuck problem when the game is loaded on a phone. So for your gaming experience, I made it defaults false. If you are confident with your device, active it. If you find your device cannot afford it, open the mod file folder and find the 'new-horizon' folder then open the properties file in it, and then rewrite the ''@active.advance-load*' to false, then open the game again."
version: "1.6.5 beta"
version: "1.6.5.1 beta"
minGameVersion: 125
20 changes: 18 additions & 2 deletions src/newhorizon/block/special/Delivery.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void configure(Object value){
super.configure(value);
if(value instanceof Integer){
if(link() != null && link() instanceof DeliveryBuild) ((DeliveryBuild)link()).acceptDelivery = null;
link = (int)value;
linkPos((int)value);
items.clear();
for(int i = 0; i < 4; i++){
Time.run(4 * i, () -> {
Expand Down Expand Up @@ -173,7 +173,7 @@ public boolean flushLink(){
}

public boolean linkValid() {
return link() != null && link() instanceof DeliveryBuild && link().team == team && link().items != null && link().isValid();
return link() != null && link().team == team && link().items != null && link().isValid();
}

@Override
Expand All @@ -200,6 +200,22 @@ public void updateTile(){
}
}

public void setNull(){
if(linkValid() && link() instanceof DeliveryBuild) ((DeliveryBuild)link()).acceptDelivery = null;
}

@Override
public void remove(){
super.remove();
setNull();
}

@Override
public void onDestroyed(){
super.onDestroyed();
setNull();
}

protected boolean shouldDeliver(){
boolean shouldDeliver = true;
if(linkValid()){
Expand Down

0 comments on commit 8098ab2

Please sign in to comment.