Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previewing an unsupported world breaks world preview for remainder of game session #2429

Closed
Cervator opened this issue Aug 3, 2016 · 1 comment · Fixed by #2815
Closed
Labels
Type: Bug Issues reporting and PRs fixing problems

Comments

@Cervator
Copy link
Member

Cervator commented Aug 3, 2016

Or at least the menu session. To reproduce:

  • Verify that with default config (Core + Perlin) you can click the Details... button on Create Game and look at a world preview.
  • Go back and pick HeightMap world instead, click the button again, get exception (pasted below)
  • Select Perlin again which worked fine before - clicking the Details... button now causes the same exception
  • Can also be done with other worlds like Island World from the PolyWorld module

Exception:

21:22:13.129 [main] ERROR o.t.r.n.l.mainMenu.CreateGameScreen - Unable to load world for a 2D preview
java.lang.NullPointerException: null
    at org.terasology.rendering.nui.layers.mainMenu.PreviewWorldScreen.setEnvironment(PreviewWorldScreen.java:117)
    at org.terasology.rendering.nui.layers.mainMenu.CreateGameScreen.lambda$initialise$152(CreateGameScreen.java:280)
    at org.terasology.rendering.nui.layers.mainMenu.CreateGameScreen$$Lambda$132/1613332278.onActivated(Unknown Source)
    at org.terasology.rendering.nui.widgets.UIButton.activate(UIButton.java:133)
    at org.terasology.rendering.nui.widgets.UIButton.access$100(UIButton.java:40)
    at org.terasology.rendering.nui.widgets.UIButton$1.onMouseRelease(UIButton.java:77)
    at org.terasology.rendering.nui.internal.CanvasImpl.processMouseRelease(CanvasImpl.java:247)
    at org.terasology.rendering.nui.internal.NUIManagerInternal.mouseButtonEvent(NUIManagerInternal.java:569)
    at org.terasology.rendering.nui.internal.NUIManagerInternalMethodAccess.invoke(Unknown Source)
    at org.terasology.entitySystem.event.internal.EventSystemImpl$ByteCodeEventHandlerInfo.invoke(EventSystemImpl.java:506)
    at org.terasology.entitySystem.event.internal.EventSystemImpl.sendConsumableEvent(EventSystemImpl.java:279)
    at org.terasology.entitySystem.event.internal.EventSystemImpl.send(EventSystemImpl.java:258)
    at org.terasology.entitySystem.entity.internal.BaseEntityRef.send(BaseEntityRef.java:145)
    at org.terasology.input.InputSystem.sendMouseEvent(InputSystem.java:503)
    at org.terasology.input.InputSystem.processMouseInput(InputSystem.java:324)
    at org.terasology.input.InputSystem.update(InputSystem.java:271)
    at org.terasology.engine.modes.StateMainMenu.handleInput(StateMainMenu.java:143)
    at org.terasology.engine.subsystem.lwjgl.LwjglInput.postUpdate(LwjglInput.java:54)
    at org.terasology.engine.TerasologyEngine.mainLoop(TerasologyEngine.java:422)
    at org.terasology.engine.TerasologyEngine.run(TerasologyEngine.java:368)
    at org.terasology.engine.Terasology.main(Terasology.java:150)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
21:22:17.083 [main] ERROR o.t.r.n.l.mainMenu.CreateGameScreen - Unable to load world for a 2D preview
java.lang.NullPointerException: null
    at org.terasology.rendering.nui.layers.mainMenu.PreviewWorldScreen.setEnvironment(PreviewWorldScreen.java:117)
...

(second exception is from the second try)

Maybe interesting to @msteiger and probably relates to the loaded context/environment. Not resetting correctly?

@Cervator Cervator added the Type: Bug Issues reporting and PRs fixing problems label Aug 3, 2016
@0shine0
Copy link
Contributor

0shine0 commented Mar 8, 2017

@Cervator The problem was that all the variables of PreviewWorldScreen that had an @in above them were set to null because the screen was created every time Details button was clicked.
It does not tackle issue #2509
Maybe you can test it for all test cases.
Gonna post a pr. Will link to it here

0shine0 added a commit to 0shine0/Terasology that referenced this issue Mar 8, 2017
0shine0 added a commit to 0shine0/Terasology that referenced this issue Mar 12, 2017
@Cervator Cervator added this to the Alpha 7 milestone Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants