Skip to content

Commit b7370ed

Browse files
committed
Fixed an issue where MakeKey, MakeGlobalKey failed to compile due to missing keyword specifier constexpr in the cpp file
Minor style adjustments
1 parent 4fd4c7f commit b7370ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ElunaMgr.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ElunaMgr::~ElunaMgr()
2424
void ElunaMgr::Create(Map* map, ElunaInfo const& info)
2525
{
2626
// If already exists, do nothing
27-
bool keyExists = (info.key != ElunaInfo::INVALID_KEY_ID) && (_elunaMap.find(info.key) != _elunaMap.end());
27+
bool keyExists = info.IsValid() && (_elunaMap.find(info.key) != _elunaMap.end());
2828
if (keyExists)
2929
return;
3030

@@ -66,12 +66,12 @@ ElunaInfo::~ElunaInfo()
6666
sElunaMgr->Destroy(key);
6767
}
6868

69-
uint64 ElunaInfo::MakeKey(uint32 mapId, uint32 instanceId)
69+
constexpr uint64 ElunaInfo::MakeKey(uint32 mapId, uint32 instanceId)
7070
{
7171
return instanceId | (static_cast<uint64>(mapId) << 32);
7272
}
7373

74-
uint64 ElunaInfo::MakeGlobalKey(uint32 instanceId)
74+
constexpr uint64 ElunaInfo::MakeGlobalKey(uint32 instanceId)
7575
{
7676
return MakeKey(GLOBAL_MAP_ID, instanceId);
7777
}
@@ -80,6 +80,7 @@ bool ElunaInfo::IsValid() const
8080
{
8181
return key != INVALID_KEY_ID;
8282
}
83+
8384
bool ElunaInfo::IsGlobal() const
8485
{
8586
return IsValid() && GetMapId() == GLOBAL_MAP_ID;

0 commit comments

Comments
 (0)