Merge branch 'master' of https://github.com/Anuken/Mindustry into crux-floor
This commit is contained in:
@@ -509,13 +509,18 @@ public class UnitAssembler extends PayloadBlock{
|
|||||||
Vec2 spawn = getUnitSpawn();
|
Vec2 spawn = getUnitSpawn();
|
||||||
consume();
|
consume();
|
||||||
|
|
||||||
if(!net.client()){
|
var unit = plan.unit.create(team);
|
||||||
var unit = plan.unit.create(team);
|
if(unit.isCommandable() && commandPos != null){
|
||||||
if(unit != null && unit.isCommandable() && commandPos != null){
|
unit.command().commandPosition(commandPos);
|
||||||
unit.command().commandPosition(commandPos);
|
}
|
||||||
}
|
unit.set(spawn.x + Mathf.range(0.001f), spawn.y + Mathf.range(0.001f));
|
||||||
unit.set(spawn.x + Mathf.range(0.001f), spawn.y + Mathf.range(0.001f));
|
unit.rotation = rotdeg();
|
||||||
unit.rotation = rotdeg();
|
var targetBuild = unit.buildOn();
|
||||||
|
//'source' is the target build instead of this building; this is because some blocks only accept things from certain angles, and this is a non-standard payload
|
||||||
|
var payload = new UnitPayload(unit);
|
||||||
|
if(targetBuild != null && targetBuild.team == team && targetBuild.acceptPayload(targetBuild, payload)){
|
||||||
|
targetBuild.handlePayload(targetBuild, payload);
|
||||||
|
}else if(!net.client()){
|
||||||
unit.add();
|
unit.add();
|
||||||
Units.notifyUnitSpawn(unit);
|
Units.notifyUnitSpawn(unit);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user