- // room names are stored in lower-case format
- // room names are stored without dots in the name, eg. "aw.1124.png" -> "aw1124.png"
- QString mapPath = QString(":/maps/rooms/%1.png").arg(event->room().toLower().remove("."));
- if(!QFile::exists(mapPath))
- mapPath = QString(":/maps/rooms/not-available.png");
-
- QString roomName;
- if(mapPath.contains("not-available", Qt::CaseInsensitive))
- roomName = QString("Map is not available: %1").arg(event->room());
- else
- roomName = event->room();
+ QVariant mapPathV = event->room()->map();
+ QString mapPath;
+ if (!mapPathV.isValid()) {
+ error_message("No map for this room");
+ return;
+ } else {
+ mapPath = mapPathV.toString();
+ if (!QFile::exists(mapPath)) {
+ error_message("Map for this room not found: " + mapPath);
+ return;
+ }
+ }