allow cancelling character creation

This commit is contained in:
Sen 2025-06-13 00:27:03 +02:00
parent 58163db658
commit 53a4f5f1a8
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
3 changed files with 21 additions and 10 deletions

View file

@ -2427,7 +2427,7 @@ public class Player extends User implements ICrafting, Executor, IPlayer
NetHandler.checkThread(packetIn, this, this.server);
CPacketAction.Action action = packetIn.getAction();
if(this.charEditor != (action == Action.SET_ALIGN || action == Action.SET_SPECIES || action == Action.SET_CLASS || action == Action.SET_HEIGHT || action == Action.CLOSE_EDITOR)) // {
if(this.charEditor != (action == Action.SET_ALIGN || action == Action.SET_SPECIES || action == Action.SET_CLASS || action == Action.SET_HEIGHT || action == Action.CLOSE_EDITOR || action == Action.CANCEL_EDITOR)) // {
// if(this.local && action == Action.CLOSE_EDITOR)
// this.server.setDone();
return;
@ -2464,6 +2464,17 @@ public class Player extends User implements ICrafting, Executor, IPlayer
// this.server.setDone();
break;
}
case CANCEL_EDITOR: {
int index = packetIn.getAuxData();
if(index >= this.characters.size() || index < 0)
return;
this.charEditor = false;
this.server.swapPlayer(this, this.characters.get(index), null);
this.selected = index;
this.sendPacket(new SPacketCharacterList(this.selected));
break;
}
case SELECT_CHARACTER: {
int index = packetIn.getAuxData();