tchegito / zildo

The Land of Alembrume
GNU Lesser General Public License v3.0
4 stars 1 forks source link

[2.55] IllegalArgumentException navigating through menu pages #170

Closed tchegito closed 5 years ago

tchegito commented 5 years ago

Happened twice for the same player (enila):

version=v2.55
map=foret (64x64)
sprites=[Perso=Zildo
Coords:(581.75977, 497.6483 0.0)
info=ZILDO
mvt=VIDE pv=5 weapon=[SWORD,0] name=enila lasthit=last hit by Perso=green2
Coords:(594.4197, 557.3198 0.0) ==> (570,497)
info=ENEMY
mvt=TOUCHE pv=1 on polaky, 582.75977, 507.6483 (80 - bank 0), 691.0, 540.0 (83 - bank 0), 518.0, 149.0 (SHADOW), 579.3516, 515.4225 (103 - bank 0), 648.0, 406.0 (STONE_HEAVY), Perso=pano
Coords:(552.0, 938.0 0.0)
info=NEUTRAL
mvt=VIDE pv=1, 0.0, 0.0 (80 - bank 0), Perso=new
Coords:(523.0, 661.0 0.0) ==> (10,8)
info=ENEMY
mvt=VIDE pv=2, 523.0, 667.0 (80 - bank 0), 0.0, -12.0 (SHADOW_SMALL), Perso=new
Coords:(748.13275, 860.13275 0.0) ==> (753,868)
info=ENEMY
mvt=VIDE pv=2, 0.0, 0.0 (80 - bank 0), 748.13275, 859.13275 (SHADOW), Perso=new
Coords:(271.0799, 742.75 0.0) ==> (222,737)
info=ENEMY
mvt=VIDE pv=2, 0.0, 0.0 (80 - bank 0), 271.0799, 741.75 (SHADOW)]
persos=[Perso=Zildo
Coords:(581.75977, 497.6483 0.0)
info=ZILDO
mvt=VIDE pv=5 weapon=[SWORD,0] name=enila lasthit=last hit by Perso=green2
Coords:(594.4197, 557.3198 0.0) ==> (570,497)
info=ENEMY
mvt=TOUCHE pv=1 on polaky, Perso=pano
Coords:(552.0, 938.0 0.0)
info=NEUTRAL
mvt=VIDE pv=1, Perso=new
Coords:(523.0, 661.0 0.0) ==> (10,8)
info=ENEMY
mvt=VIDE pv=2, Perso=new
Coords:(748.13275, 860.13275 0.0) ==> (753,868)
info=ENEMY
mvt=VIDE pv=2, Perso=new
Coords:(271.0799, 742.75 0.0) ==> (222,737)
info=ENEMY
mvt=VIDE pv=2]
variables={nettleCount=-1, Carlo=[[MOON, 1], 800, 1], allowedDynamite=yes, Dizzie=[[DYNAMITE, 1], 15, 20], BilelIgorVillage=[[EMPTY_BAG, 1], 100, 2], [[BLUEDROP, 1], 15, -1], [[DYNAMITE, 1], 100, 2]}
scripts=0 scripts running {[}
quests=[flut_ask, flut, chateau_ask, enlevebuissons, enlevebuissons_win, gardelaitier, gardelaitier_win, ritou_bar, enlevement, hector_1, start_defi1, stop_defi1, start_visit1, suite_visit1_weapon, maltus_foret, maltus_foret_zildo_defeat, foretg_button_trig, foretg_apres_grotte, bosquet_kill_gards, bosquet_free_way, voyante, fermem2(7, 15), prisonext(40, 40), trip_polaky, polaky3(2, 7), bosquetbosquetm2, foret(36, 30)]
lastdialog=Lugdunia Forest
�Eric�: Do you want to try to get in the house?
�Eric�: I've always wondered what's inside, but I'm too scared to set foot near there.
�Eric�: Hi! Did you see the house on the hill? It has been abandoned for quite a while!
Polaky
�Sofiasky�: Are you enjoying Polaky, boy?
�Igorsky�: I prefer to stay quiet here. You should go for a walk to the Clearing if you're in a good mood.
�Igorsky�: Life was peacefulsky for the last twenty years, then suddenly, bang! All has started to...Err, I can't say anything more.
�Igorsky�: It is said that the Marquis is being influenced from somewhere else. I don't know exactly what it is, but trust me, something is wrong.
�Igorsky�: What do you want from the old Igorsky? For some time, this tavern has been empty. Nobody comes to hear my stories anymore.
�Sofiasky�: Maltus?
�Maltus�: Incredible, it's Sofiasky!
�Maltus�: Come on enila, follow me. Let's enter Polaky.
�Maltus�: Don't forget that we are just scouts. All we have to do is gather some information for the King.
�Maltus�: But we have to find out where and why the Princess has been taken.
�Maltus�: Here we are, on the gates of Polaky. As far as we know, this land is friendly.
Lugdunia Forest
�Maltus�: Remember, always keep your head. You cannot be harmed as long as you stay with me.
�Maltus�: So enila, are you proud to be going with me on a mission for King Trion?
�Maltus�: Well done, boy. Let's go!
�Maltus�: There are guards patrolling here. enila, defeat them and come back as soon as the way is clear.
�Maltus�: This way.
�Maltus�: Follow me, we are close to Polaky.
java.lang.IllegalArgumentException
    at java.util.AbstractList.subList(AbstractList.java:736)
    at zildo.fwk.ui.PageableMenu.initCurrentPage(PageableMenu.java:80)
    at zildo.fwk.ui.PageableMenu.changePage(PageableMenu.java:127)
    at zildo.fwk.ui.PageableMenu.nextPage(PageableMenu.java:134)
    at zildo.fwk.ui.PageableMenu.access$0(PageableMenu.java:132)
    at zildo.fwk.ui.PageableMenu$2.run(PageableMenu.java:87)
    at zildo.client.Client.mainLoop(Client.java:242)
    at com.alembrum.OpenGLRenderer.onDrawFrame(OpenGLRenderer.java:116)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1522)
    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)
tchegito commented 5 years ago

It seems a sub list is created from A to B, where A > B. That may not be possible !

tchegito commented 5 years ago

[Fixed in 2.56]

Apparently, with a really quick finger, we can press twice "Next page" button, when list is on the penultimate page. We isolated this with a unit test, so it's fixed now.

96ba1a40cb63198c584ca6bd333420120a995dd9