Various tweaks and speculative changes
This commit is contained in:
@@ -97,7 +97,7 @@ public class LaunchPad extends Block{
|
||||
//launch when full and base conditions are met
|
||||
if(items.total() >= itemCapacity && efficiency() >= 1f && timer(timerLaunch, launchTime / timeScale)){
|
||||
LaunchPayload entity = LaunchPayload.create();
|
||||
items.each((item, amount) -> entity.stacks().add(new ItemStack(item, amount)));
|
||||
items.each((item, amount) -> entity.stacks.add(new ItemStack(item, amount)));
|
||||
entity.set(this);
|
||||
entity.lifetime(120f);
|
||||
entity.team(team);
|
||||
@@ -174,9 +174,14 @@ public class LaunchPad extends Block{
|
||||
|
||||
@Override
|
||||
public void remove(){
|
||||
if(!state.isCampaign()) return;
|
||||
|
||||
//on multiplayer the destination is a the first captured sector (basically random)
|
||||
Sector destsec = !net.client() ? state.secinfo.origin : state.rules.sector.planet.sectors.find(Sector::hasBase);
|
||||
|
||||
//actually launch the items upon removal
|
||||
if(team() == state.rules.defaultTeam && state.secinfo.origin != null){
|
||||
ItemSeq dest = state.secinfo.origin.getExtraItems();
|
||||
if(team() == state.rules.defaultTeam && destsec != null){
|
||||
ItemSeq dest = destsec.getExtraItems();
|
||||
|
||||
for(ItemStack stack : stacks){
|
||||
dest.add(stack);
|
||||
@@ -186,7 +191,7 @@ public class LaunchPad extends Block{
|
||||
Events.fire(new LaunchItemEvent(stack));
|
||||
}
|
||||
|
||||
state.secinfo.origin.setExtraItems(dest);
|
||||
destsec.setExtraItems(dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user