diff --git a/src/mapdata/mapdata.cpp b/src/mapdata/mapdata.cpp index f10d3cdf4..5f32990eb 100644 --- a/src/mapdata/mapdata.cpp +++ b/src/mapdata/mapdata.cpp @@ -27,6 +27,7 @@ #include "mapdata.h" #include "roomfactory.h" #include "drawstream.h" +#include "mmapper2room.h" #include using namespace std; @@ -95,7 +96,7 @@ void MapData::toggleRoomFlag(const Coordinate & pos, uint flag, uint field) { QMutexLocker locker(&mapLock); Room * room = map.get(pos); - if (room && field < 10) + if (room && field < ROOMFIELD_LAST ) { setDataChanged(); MapAction * action = new SingleRoomAction(new ModifyRoomFlags(flag, field, FMM_TOGGLE), room->getId()); @@ -107,7 +108,7 @@ bool MapData::getRoomFlag(const Coordinate & pos, uint flag, uint field) { QMutexLocker locker(&mapLock); Room * room = map.get(pos); - if (room && field < 10) + if (room && field < ROOMFIELD_LAST ) { if (ISSET((*room)[field].toUInt(), flag)) return true; } @@ -118,7 +119,7 @@ void MapData::setRoomField(const Coordinate & pos, uint flag, uint field) { QMutexLocker locker(&mapLock); Room * room = map.get(pos); - if (room && field < 10) + if (room && field < ROOMFIELD_LAST ) { setDataChanged(); MapAction * action = new SingleRoomAction(new UpdateRoomField(flag, field), room->getId()); @@ -130,7 +131,7 @@ uint MapData::getRoomField(const Coordinate & pos, uint field) { QMutexLocker locker(&mapLock); Room * room = map.get(pos); - if (room && field < 10) + if (room && field < ROOMFIELD_LAST ) { return (*room)[field].toUInt(); } diff --git a/src/mapdata/mmapper2room.h b/src/mapdata/mmapper2room.h index 387e9f7cb..7ea9d17c6 100644 --- a/src/mapdata/mmapper2room.h +++ b/src/mapdata/mmapper2room.h @@ -78,7 +78,7 @@ typedef quint16 RoomMobFlags; #define RLF_TOWER bit16 typedef quint16 RoomLoadFlags; -enum RoomField {R_NAME, R_DESC, R_TERRAINTYPE, R_DYNAMICDESC, R_NOTE, R_MOBFLAGS, R_LOADFLAGS, R_PORTABLETYPE, R_LIGHTTYPE, R_ALIGNTYPE, R_RIDABLETYPE}; +enum RoomField {R_NAME, R_DESC, R_TERRAINTYPE, R_DYNAMICDESC, R_NOTE, R_MOBFLAGS, R_LOADFLAGS, R_PORTABLETYPE, R_LIGHTTYPE, R_ALIGNTYPE, R_RIDABLETYPE, ROOMFIELD_LAST}; RoomName getName(const Room * room);