v0.4.2: hero.handle no longer actually acts, just sets up action
This prevents hero actions from running on the UI thread incorrectly
This commit is contained in:
parent
1293607b42
commit
c29cef8907
|
@ -1012,7 +1012,7 @@ public class Hero extends Char {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getCloser( final int target ) {
|
private boolean getCloser( final int target ) {
|
||||||
|
|
||||||
if (rooted) {
|
if (rooted) {
|
||||||
Camera.main.shake( 1, 1f );
|
Camera.main.shake( 1, 1f );
|
||||||
return false;
|
return false;
|
||||||
|
@ -1021,7 +1021,7 @@ public class Hero extends Char {
|
||||||
int step = -1;
|
int step = -1;
|
||||||
|
|
||||||
if (Dungeon.level.adjacent( pos, target )) {
|
if (Dungeon.level.adjacent( pos, target )) {
|
||||||
|
|
||||||
if (Actor.findChar( target ) == null) {
|
if (Actor.findChar( target ) == null) {
|
||||||
if (Level.pit[target] && !flying && !Level.solid[target]) {
|
if (Level.pit[target] && !flying && !Level.solid[target]) {
|
||||||
if (!Chasm.jumpConfirmed){
|
if (!Chasm.jumpConfirmed){
|
||||||
|
@ -1038,7 +1038,7 @@ public class Hero extends Char {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
int len = Dungeon.level.length();
|
int len = Dungeon.level.length();
|
||||||
boolean[] p = Level.passable;
|
boolean[] p = Level.passable;
|
||||||
boolean[] v = Dungeon.level.visited;
|
boolean[] v = Dungeon.level.visited;
|
||||||
|
@ -1047,10 +1047,10 @@ public class Hero extends Char {
|
||||||
for (int i=0; i < len; i++) {
|
for (int i=0; i < len; i++) {
|
||||||
passable[i] = p[i] && (v[i] || m[i]);
|
passable[i] = p[i] && (v[i] || m[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
step = Dungeon.findStep( this, pos, target, passable, Level.fieldOfView );
|
step = Dungeon.findStep( this, pos, target, passable, Level.fieldOfView );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (step != -1) {
|
if (step != -1) {
|
||||||
|
|
||||||
sprite.move(pos, step);
|
sprite.move(pos, step);
|
||||||
|
@ -1126,7 +1126,7 @@ public class Hero extends Char {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return act();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void earnExp( int exp ) {
|
public void earnExp( int exp ) {
|
||||||
|
|
|
@ -167,7 +167,9 @@ public class AttackIndicator extends Tag {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
Dungeon.hero.handle( lastTarget.pos );
|
if (Dungeon.hero.handle( lastTarget.pos )) {
|
||||||
|
Dungeon.hero.next();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,10 @@ public class LootIndicator extends Tag {
|
||||||
|
|
||||||
slot = new ItemSlot() {
|
slot = new ItemSlot() {
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
Dungeon.hero.handle( Dungeon.hero.pos );
|
if (Dungeon.hero.handle(Dungeon.hero.pos)){
|
||||||
|
Dungeon.hero.next();
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
slot.showParams( true, false, false );
|
slot.showParams( true, false, false );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user