Make missile units not be affected by map border. (#7530)

* Unbounded units

* Unbound missiles
This commit is contained in:
MEEPofFaith
2022-09-08 09:58:29 -07:00
committed by GitHub
parent b7e8c211f7
commit 2f5f984416
3 changed files with 7 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.type.*;
import static mindustry.Vars.*;
@@ -12,11 +13,14 @@ import static mindustry.Vars.*;
abstract class BoundedComp implements Velc, Posc, Healthc, Flyingc{
static final float warpDst = 30f;
@Import UnitType type;
@Import float x, y;
@Import Team team;
@Override
public void update(){
if(!type.bounded) return;
float bot = 0f, left = 0f, top = world.unitHeight(), right = world.unitWidth();
//TODO hidden map rules only apply to player teams? should they?

View File

@@ -208,6 +208,8 @@ public class UnitType extends UnlockableContent{
hidden = false,
/** if true, this unit is for internal use only and does not have a sprite generated. */
internal = false,
/** If false, this unit is not pushed away from map edges. */
bounded = true,
/** if true, this unit is detected as naval - do NOT assign this manually! Initialized in init() */
naval = false,

View File

@@ -25,6 +25,7 @@ public class MissileUnitType extends UnitType{
envEnabled = Env.any;
envDisabled = Env.none;
physics = false;
bounded = false;
trailLength = 7;
hidden = true;
speed = 4f;