Libgdx / Java创建/删除实体会创建Java日志错误

时间:2016-07-08 16:09:31

标签: java error-handling libgdx box2d

每次我尝试删除或创建一些实体时,我都会在此处收到此错误日志:

http://pastebin.com/nTgsNdzZ

我删除/创建我的身体:

删除:

android:name="android.support.multidex.MultiDexApplication">

创建:

@Override
public void onDead() {

    super.onDead();

    /*
    attackTimer.cancel();
    attackTimer.purge();

    resetTimer.cancel();
    resetTimer.purge();
    */

    if(!game.hostServer && ! gameScreen.launcher.network.client.isConnected()){

        boolean spawned = false;

        while(!spawned){            

            int rdmChance = ThreadLocalRandom.current().nextInt(-2, 1 + 1);

            switch (rdmChance) {

            default : 

                spawned = true;

                break;

            case 1:

                HealthTank spawnedTank = new HealthTank(gameScreen, entityBody.getPosition());

                gameScreen.items.add(spawnedTank);

                spawned = true;

                break;

            }

        }

    }

    if(!gameScreen.lightManager.world.isLocked() && entityBody.getUserData() != null && entityBody != null ){

        entityBody.setUserData(null);

        activated = false;

        gameScreen.lightManager.world.destroyBody(entityBody);

    }

    removeNetworkEntity();

}

我做错了什么?我检查世界是否被锁定,是否我将创建:/

1 个答案:

答案 0 :(得分:0)

- 推 -

仍然没有解决方案,我只是发现这只会出现,当我摧毁一个身体并在那之后产生一个新身体