Merge branch 'fix-mannequin' into 'dev'

Fix mannequin name

See merge request morningstar/Arcturus-Community!539
This commit is contained in:
Harmonic 2022-04-14 22:23:36 +00:00
commit 7e2beb83ce
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 {