Fix Warp util class
This commit is contained in:
@@ -35,6 +35,11 @@ public class Warp extends EntityDelegate {
|
|||||||
public void update(float dt) {
|
public void update(float dt) {
|
||||||
if (entity != null && entity.getCoordinates().equals(getCoordinates())) {
|
if (entity != null && entity.getCoordinates().equals(getCoordinates())) {
|
||||||
beforeWarp();
|
beforeWarp();
|
||||||
|
|
||||||
|
if(entity.getLayer() != null) {
|
||||||
|
entity.getLayer().removeEntity(entity);
|
||||||
|
}
|
||||||
|
|
||||||
context.openMap(mapUid);
|
context.openMap(mapUid);
|
||||||
context.getMap().getObjectLayer(layer).addEntity(entity);
|
context.getMap().getObjectLayer(layer).addEntity(entity);
|
||||||
entity.setCoordinates(x, y);
|
entity.setCoordinates(x, y);
|
||||||
|
|||||||
Reference in New Issue
Block a user