Adjust sort logic
This commit is contained in:
parent
f074444521
commit
19b69b91a9
|
@ -10,10 +10,10 @@ export class PlayerEntity extends Entity {
|
|||
act(actions: Action[]) {
|
||||
this.action = actions.sort((a, b) => {
|
||||
if (a.priority < b.priority) {
|
||||
return -1
|
||||
return 1
|
||||
}
|
||||
if (a.priority > b.priority) {
|
||||
return 1
|
||||
return -1
|
||||
}
|
||||
return 0
|
||||
})[0]
|
||||
|
|
Loading…
Reference in New Issue
Block a user