Adjust sort logic

This commit is contained in:
Ketchetwahmeegwun T. Southall 2022-01-29 20:30:56 -08:00
parent f074444521
commit 19b69b91a9

View File

@ -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]