v0.4.3a: fixed nullpointer exceptions caused by new blob bundle restore behaviour
This commit is contained in:
parent
46615e0949
commit
b104ad197d
|
@ -37,12 +37,13 @@ public class Alchemy extends Blob {
|
|||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
|
||||
for (int i=0; i < cur.length; i++) {
|
||||
if (cur[i] > 0) {
|
||||
pos = i;
|
||||
break;
|
||||
if (volume > 0)
|
||||
for (int i=0; i < cur.length; i++) {
|
||||
if (cur[i] > 0) {
|
||||
pos = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -245,7 +245,7 @@ public class Blob extends Actor {
|
|||
|
||||
public static int volumeAt( int cell, Class<? extends Blob> type){
|
||||
Blob gas = Dungeon.level.blobs.get( type );
|
||||
if (gas == null) {
|
||||
if (gas == null || gas.volume == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return gas.cur[cell];
|
||||
|
|
|
@ -41,12 +41,13 @@ public class WellWater extends Blob {
|
|||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
|
||||
for (int i=0; i < cur.length; i++) {
|
||||
if (cur[i] > 0) {
|
||||
pos = i;
|
||||
break;
|
||||
if (volume > 0)
|
||||
for (int i=0; i < cur.length; i++) {
|
||||
if (cur[i] > 0) {
|
||||
pos = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -66,7 +66,7 @@ public class PotionOfPurity extends Potion {
|
|||
for (int j=0; j < blobs.length; j++) {
|
||||
|
||||
Blob blob = blobs[j];
|
||||
if (blob == null) {
|
||||
if (blob == null || blob.volume == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ public class WndInfoCell extends Window {
|
|||
add(info);
|
||||
|
||||
for (Blob blob:Dungeon.level.blobs.values()) {
|
||||
if (blob.cur[cell] > 0 && blob.tileDesc() != null) {
|
||||
if (blob.volume > 0 && blob.cur[cell] > 0 && blob.tileDesc() != null) {
|
||||
if (desc.length() > 0) {
|
||||
desc += "\n\n";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user