mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-06 16:27:34 +07:00
Fixes error when creating a new character
This commit is contained in:
@ -479,6 +479,17 @@ public class Engine extends PooledEngine {
|
||||
|
||||
CofComponent cofComponent = createComponent(CofComponent.class);
|
||||
cofComponent.mode = Player.MODE_TN;
|
||||
if (charData.getD2S().file == null) {
|
||||
// FIXME: extra checks to prevent crashes due to no save file existing -- see TransformUpdateSystem NPE fix
|
||||
cofComponent.wclass = CofComponent.WEAPON_HTH;
|
||||
cofComponent.setComponent(COF.Component.HD, CofComponent.COMPONENT_LIT);
|
||||
cofComponent.setComponent(COF.Component.TR, CofComponent.COMPONENT_LIT);
|
||||
cofComponent.setComponent(COF.Component.LG, CofComponent.COMPONENT_LIT);
|
||||
cofComponent.setComponent(COF.Component.RA, CofComponent.COMPONENT_LIT);
|
||||
cofComponent.setComponent(COF.Component.LA, CofComponent.COMPONENT_LIT);
|
||||
cofComponent.setComponent(COF.Component.S1, CofComponent.COMPONENT_LIT);
|
||||
cofComponent.setComponent(COF.Component.S2, CofComponent.COMPONENT_LIT);
|
||||
}
|
||||
|
||||
AnimationComponent animationComponent = createComponent(AnimationComponent.class);
|
||||
|
||||
|
@ -36,7 +36,9 @@ public class TransformUpdateSystem extends IteratingSystem {
|
||||
for (int l = 0, numLayers = cof.getNumLayers(); l < numLayers; l++) {
|
||||
int component = cofComponent.cof.getLayer(l).component;
|
||||
if (!Dirty.isDirty(flags, component)) continue;
|
||||
animation.getLayer(component).setTransform(transform[component]);
|
||||
// FIXME: NPE check here shouldn't be needed -- see note in Engine#createPlayer
|
||||
Animation.Layer layer = animation.getLayer(component);
|
||||
if (layer != null) layer.setTransform(transform[component]);
|
||||
}
|
||||
|
||||
entity.remove(TransformUpdate.class);
|
||||
|
@ -330,7 +330,6 @@ public class CreateCharacterScreen extends ScreenAdapter {
|
||||
Riiablo.client.addScreenBoundsListener(screenBoundsListener = new Client.ScreenBoundsListener() {
|
||||
@Override
|
||||
public void updateScreenBounds(float x, float y, float width, float height) {
|
||||
System.out.println("y = " + y);
|
||||
charOptions.setPosition(stage.getWidth() / 2, y + 20, Align.bottom | Align.center);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user