FloorPlanValidation is now like Habbo. Doesn't allow different lengths from line 1.

This commit is contained in:
KrewsOrg 2019-07-22 11:47:32 +01:00
parent 77be0527a7
commit 08551ecff7

View File

@ -50,6 +50,21 @@ public class FloorPlanEditorSaveEvent extends MessageHandler {
errors.add("${notification.floorplan_editor.error.title}");
}
boolean rowCountCorrect = true;
int rowCount = 0;
String[] splitMap = map.split(((char) 13) + "");
for (String s : splitMap) {
if(rowCount > 0 && rowCount != s.length()) {
rowCountCorrect = false;
}
rowCount = s.length();
}
if (!rowCountCorrect && Emulator.getConfig().getBoolean("hotel.room.floorplan.check.enabled"))
{
errors.add("Invalid Rowcount");
}
if (map.isEmpty() || map.replace("x", "").replace(((char) 13) + "", "").length() == 0) {
errors.add("${notification.floorplan_editor.error.message.effective_height_is_0}");