Skip to content

Commit 44c4cf5

Browse files
committed
Fixed Linux compilation #3
Addendum to 34bea4d
1 parent 7e628fe commit 44c4cf5

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

Shared/mods/deathmatch/logic/CMapEventManager.cpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ bool CMapEventManager::Delete(CLuaMain* pLuaMain)
107107

108108
void CMapEventManager::DeleteAll(void)
109109
{
110-
Delete([&](const std::unique_ptr<CMapEvent>&) { return true; });
110+
Delete([](const std::unique_ptr<CMapEvent>&) { return true; });
111111
}
112112

113113
#ifdef MTA_CLIENT
@@ -348,28 +348,29 @@ void CMapEventManager::TakeOutTheTrash()
348348
// Clear the trashcan
349349
m_TrashCan.clear();
350350
}
351-
351+
template<typename T> struct foo{};
352352
bool CMapEventManager::HandleExists(CLuaMain* pLuaMain, const std::string& strName, const CLuaFunctionRef& iLuaFunction)
353353
{
354354
// Return true if we find an event which matches the handle
355355
EventsIterPair itPair = m_EventsMap.equal_range(strName);
356356
return std::find_if(itPair.first, itPair.second,
357-
[&](const auto& pair) {
358-
const auto& pMapEvent = pair.second;
359-
// Is it not being destroyed?
360-
if (pMapEvent->IsBeingDestroyed())
361-
return false;
362-
// Same lua main?
363-
if (pMapEvent->GetVM() != pLuaMain)
364-
return false;
365-
// Same name?
366-
dassert(pMapEvent->GetName() == strName);
367-
// Same lua function?
368-
if (pMapEvent->GetLuaFunction() != iLuaFunction)
369-
return false;
370-
// It exists
371-
return true;
372-
}) != itPair.second;
357+
[&](const std::pair<const std::string, std::unique_ptr<CMapEvent>>& pair)
358+
{
359+
const auto& pMapEvent = pair.second;
360+
// Is it not being destroyed?
361+
if (pMapEvent->IsBeingDestroyed())
362+
return false;
363+
// Same lua main?
364+
if (pMapEvent->GetVM() != pLuaMain)
365+
return false;
366+
// Same name?
367+
dassert(pMapEvent->GetName() == strName);
368+
// Same lua function?
369+
if (pMapEvent->GetLuaFunction() != iLuaFunction)
370+
return false;
371+
// It exists
372+
return true;
373+
}) != itPair.second;
373374
}
374375

375376
void CMapEventManager::GetHandles(CLuaMain* pLuaMain, const std::string& strName, lua_State* luaVM)

Shared/mods/deathmatch/logic/CMapEventManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CMapEventManager
4242
using EventsIterPair = std::pair<EventsIter, EventsIter>;
4343

4444
template <typename Predicate>
45-
bool Delete(Predicate& pred)
45+
bool Delete(const Predicate& pred)
4646
{
4747
bool bRemovedSomeone = false;
4848
auto iter = m_EventsMap.begin();

0 commit comments

Comments
 (0)