Closed GoogleCodeExporter closed 9 years ago
issue succesfully reproduced by dooke.
Original comment by Fobbah
on 9 Jul 2011 at 4:14
fix:
It seems that gameUpdate() was removing all units it thought were "dead" - it
initialised the list of dead units as the list of all units from the last
frame, but did not remove units that were still alive from the list of dead
units - thus every frame, any unit that was in the list of units last frame was
removed, and the frame after that, re-added.
One line fix:
in JNIBWAPI.java -> JNIBWAPI.gameUpdate()
...
ArrayList<Unit> neutralList = new ArrayList<Unit>();
System.out.println("frm: " + gameFrame + " - " + unitData.length);
for (int index=0; index<unitData.length; index += Unit.numAttributes) {
int id = unitData[index];
Unit unit = units.get(id);
deadUnits.remove(id); ///ADD THIS LINE
if (unit == null) {
unit = new Unit(id);
units.put(id, unit); }
...
Original comment by Fobbah
on 9 Jul 2011 at 5:19
Original comment by LukeDic...@gmail.com
on 15 Jul 2011 at 8:37
Original issue reported on code.google.com by
Fobbah
on 9 Jul 2011 at 4:08