I have discovered a small bug with pets. When you place a pet the room_id of the pets get saved and when you leave the room, the room_id gets set back to -1 (so the pet is back in your hand). However... When you enter the "stop" command during your session in the room with the pet, in the next relog of the client+server the pet is still there.
So basically, on EVERY room LEAVE, the pet gets put back to -1 in the database for a room_id.
Other than that its a very nice emulator. Hopefully somebody can give me a fix for the pet issue and I will certainly use it for production.
- - - Updated - - -
Seems I have already fixed the issue :)! It was with the kick void. When you leave the room it instantly trigger the removeBotFromRoom, where is defined to put -1 in room_id. Fixed by creating a new TakeBot void, and adding:
Code:
public void takePet() {
if (this.isBot() && this.isPet()) {
this.room.removeBotFromRoom(this);
}
}
public void kick(final boolean soft) {
if (this.isBot() && !this.isPet()) {
this.room.removeBotFromRoom(this);
return;
}
And changing the packethandler to use takePet, for picking up pets.