From dd0b5f791c84ec8a7d9ceb5ff6c601386eea21b1 Mon Sep 17 00:00:00 2001 From: NiChrosia Date: Wed, 26 May 2021 18:37:33 -0500 Subject: [PATCH] Add spawn function with Position argument to UnitType (#5293) --- core/src/mindustry/type/UnitType.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 189cba007c..713c9cdf52 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -145,6 +145,14 @@ public class UnitType extends UnlockableContent{ return spawn(state.rules.defaultTeam, x, y); } + public Unit spawn(Team team, Position pos){ + return spawn(team, pos.getX(), pos.getY()); + } + + public Unit spawn(Position pos){ + return spawn(state.rules.defaultTeam, pos); + } + public boolean hasWeapons(){ return weapons.size > 0; }