Smujb / powered-pixel-dungeon

Powered Pixel Dungeon - a mod of Shattered Pixel Dungeon that reworks many aspects of gameplay.
GNU General Public License v3.0
9 stars 2 forks source link

Throwing scrap crashes the game #11

Closed Similacrest closed 4 years ago

Similacrest commented 4 years ago

Throwing scrap made by weapon kit leads to a crash:


***** UCE HANDLER Library 
***** by Rohit Surwase 

***** DEVICE INFO 
Brand: Xiaomi
Device: nitrogen
Model: MI MAX 3
Manufacturer: Xiaomi
Product: nitrogen
SDK: 29
Release: 10.0

***** APP INFO 
Version: 0.4.4-INDEV
Installed On: 2020-03-28 06:49:49
Updated On: 2020-06-12 21:58:56
Current Date: 2020-06-13 13:41:59

***** ERROR LOG 
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.shatteredpixel.yasd.general.items.Item.onThrow(int)' on a null object reference
 at com.shatteredpixel.yasd.general.items.Item$3.call(Item.java:691)
 at com.shatteredpixel.yasd.general.sprites.MissileSprite.onComplete(MissileSprite.java:164)
 at com.watabou.noosa.tweeners.Tweener.onComplete(Tweener.java:79)
 at com.watabou.noosa.tweeners.Tweener.update(Tweener.java:66)
 at com.watabou.noosa.Group.update(Group.java:76)
 at com.watabou.noosa.Group.update(Group.java:76)
 at com.watabou.noosa.Scene.update(Scene.java:74)
 at com.shatteredpixel.yasd.general.scenes.GameScene.update(GameScene.java:569)
 at com.watabou.noosa.Game.update(Game.java:251)
 at com.watabou.noosa.Game.step(Game.java:218)
 at com.watabou.noosa.Game.render(Game.java:149)
 at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:494)
 at android.opengl.GLSurfaceView$GLThread.guardedRun(Unknown Source:548)
 at android.opengl.GLSurfaceView$GLThread.run(Unknown Source:24)

***** END OF LOG *****
Smujb commented 4 years ago

Seems this is caused by Scrap having 0 quantity when thrown. Should be easy to fix - I'll just remove it from the inventory if the amount reaches 0.

Smujb commented 4 years ago

Fixed by https://github.com/Smujb/yet-another-shattered-dungeon/commit/a362d20960dd1b1b359269faef25a3419b71d7ec