Skip to content

Commit

Permalink
getRoom() will return nullptr if the room id is negative (#2976)
Browse files Browse the repository at this point in the history
  • Loading branch information
vadi2 committed Aug 13, 2019
1 parent 437893b commit 65dcd17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/TLuaInterpreter.cpp
Expand Up @@ -4848,6 +4848,10 @@ int TLuaInterpreter::searchRoom(lua_State* L)
if (!roomIdsFound.isEmpty()) {
for (int i : roomIdsFound) {
TRoom* pR = host.mpMap->mpRoomDB->getRoom(i);
if (!pR) {
continue;
}

QString name = pR->name;
int roomID = pR->getId();
lua_pushnumber(L, roomID);
Expand Down

0 comments on commit 65dcd17

Please sign in to comment.