Fix mannequin name

This commit is contained in:
brenoepic 2022-04-12 23:03:48 -03:00
parent 890cdd519a
commit ab5c491aa5
2 changed files with 9 additions and 1 deletions

View File

@ -85,3 +85,6 @@ INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.success.cmd_upda
-- add moodlight configuration
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('moodlight.color_check.enabled', '1');
-- Mannequin name
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('hotel.mannequin.name.default', 'My look');

View File

@ -18,6 +18,11 @@ public class MannequinSaveNameEvent extends MessageHandler {
String[] data = item.getExtradata().split(":");
String name = this.packet.readString();
if (name.length() < 3 || name.length() > 15) {
name = Emulator.getTexts().getValue("hotel.mannequin.name.default", "My look");
}
if (data.length == 3) {
item.setExtradata(this.client.getHabbo().getHabboInfo().getGender().name().toUpperCase() + ":" + data[1] + ":" + name);
} else {