Editor fixes
This commit is contained in:
@@ -38,6 +38,13 @@ public class EditorTile extends Tile{
|
||||
super.setFloor(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOcclusion(){
|
||||
super.updateOcclusion();
|
||||
|
||||
ui.editor.editor.renderer().updatePoint(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlock(Block type, Team team, int rotation){
|
||||
if(state.isGame()){
|
||||
|
||||
16
core/src/mindustry/entities/def/PayloadComp.java
Normal file
16
core/src/mindustry/entities/def/PayloadComp.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package mindustry.entities.def;
|
||||
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.world.blocks.payloads.*;
|
||||
|
||||
/** An entity that holds a payload. */
|
||||
@Component
|
||||
abstract class PayloadComp{
|
||||
//TODO multiple payloads?
|
||||
@Nullable Payload payload;
|
||||
|
||||
boolean hasPayload(){
|
||||
return payload != null;
|
||||
}
|
||||
}
|
||||
@@ -491,12 +491,13 @@ public class Tile implements Position, QuadTreeObject{
|
||||
|
||||
//remove this tile's dangling entities
|
||||
if(entity.block().isMultiblock()){
|
||||
int cx = entity.tileX(), cy = entity.tileY();
|
||||
int size = entity.block().size;
|
||||
int offsetx = -(size - 1) / 2;
|
||||
int offsety = -(size - 1) / 2;
|
||||
for(int dx = 0; dx < size; dx++){
|
||||
for(int dy = 0; dy < size; dy++){
|
||||
Tile other = world.tile(x + dx + offsetx, y + dy + offsety);
|
||||
Tile other = world.tile(cx + dx + offsetx, cy + dy + offsety);
|
||||
if(other != null){
|
||||
//reset entity and block *manually* - thus, preChanged() will not be called anywhere else, for multiblocks
|
||||
if(other != this){ //do not remove own entity so it can be processed in changed()
|
||||
|
||||
Reference in New Issue
Block a user