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 ) {
|
||||
|
||||
|
||||
if (rooted) {
|
||||
Camera.main.shake( 1, 1f );
|
||||
return false;
|
||||
|
@ -1021,7 +1021,7 @@ public class Hero extends Char {
|
|||
int step = -1;
|
||||
|
||||
if (Dungeon.level.adjacent( pos, target )) {
|
||||
|
||||
|
||||
if (Actor.findChar( target ) == null) {
|
||||
if (Level.pit[target] && !flying && !Level.solid[target]) {
|
||||
if (!Chasm.jumpConfirmed){
|
||||
|
@ -1038,7 +1038,7 @@ public class Hero extends Char {
|
|||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
int len = Dungeon.level.length();
|
||||
boolean[] p = Level.passable;
|
||||
boolean[] v = Dungeon.level.visited;
|
||||
|
@ -1047,10 +1047,10 @@ public class Hero extends Char {
|
|||
for (int i=0; i < len; i++) {
|
||||
passable[i] = p[i] && (v[i] || m[i]);
|
||||
}
|
||||
|
||||
|
||||
step = Dungeon.findStep( this, pos, target, passable, Level.fieldOfView );
|
||||
}
|
||||
|
||||
|
||||
if (step != -1) {
|
||||
|
||||
sprite.move(pos, step);
|
||||
|
@ -1126,7 +1126,7 @@ public class Hero extends Char {
|
|||
|
||||
}
|
||||
|
||||
return act();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void earnExp( int exp ) {
|
||||
|
|
|
@ -167,7 +167,9 @@ public class AttackIndicator extends Tag {
|
|||
@Override
|
||||
protected void onClick() {
|
||||
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() {
|
||||
protected void onClick() {
|
||||
Dungeon.hero.handle( Dungeon.hero.pos );
|
||||
if (Dungeon.hero.handle(Dungeon.hero.pos)){
|
||||
Dungeon.hero.next();
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
slot.showParams( true, false, false );
|
||||
|
|
Loading…
Reference in New Issue
Block a user