Make missile units not be affected by map border. (#7530)
* Unbounded units * Unbound missiles
This commit is contained in:
@@ -5,6 +5,7 @@ import arc.util.*;
|
|||||||
import mindustry.annotations.Annotations.*;
|
import mindustry.annotations.Annotations.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
import mindustry.type.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -12,11 +13,14 @@ import static mindustry.Vars.*;
|
|||||||
abstract class BoundedComp implements Velc, Posc, Healthc, Flyingc{
|
abstract class BoundedComp implements Velc, Posc, Healthc, Flyingc{
|
||||||
static final float warpDst = 30f;
|
static final float warpDst = 30f;
|
||||||
|
|
||||||
|
@Import UnitType type;
|
||||||
@Import float x, y;
|
@Import float x, y;
|
||||||
@Import Team team;
|
@Import Team team;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
|
if(!type.bounded) return;
|
||||||
|
|
||||||
float bot = 0f, left = 0f, top = world.unitHeight(), right = world.unitWidth();
|
float bot = 0f, left = 0f, top = world.unitHeight(), right = world.unitWidth();
|
||||||
|
|
||||||
//TODO hidden map rules only apply to player teams? should they?
|
//TODO hidden map rules only apply to player teams? should they?
|
||||||
|
|||||||
@@ -208,6 +208,8 @@ public class UnitType extends UnlockableContent{
|
|||||||
hidden = false,
|
hidden = false,
|
||||||
/** if true, this unit is for internal use only and does not have a sprite generated. */
|
/** if true, this unit is for internal use only and does not have a sprite generated. */
|
||||||
internal = false,
|
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() */
|
/** if true, this unit is detected as naval - do NOT assign this manually! Initialized in init() */
|
||||||
naval = false,
|
naval = false,
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class MissileUnitType extends UnitType{
|
|||||||
envEnabled = Env.any;
|
envEnabled = Env.any;
|
||||||
envDisabled = Env.none;
|
envDisabled = Env.none;
|
||||||
physics = false;
|
physics = false;
|
||||||
|
bounded = false;
|
||||||
trailLength = 7;
|
trailLength = 7;
|
||||||
hidden = true;
|
hidden = true;
|
||||||
speed = 4f;
|
speed = 4f;
|
||||||
|
|||||||
Reference in New Issue
Block a user