Skip to content

Commit

Permalink
Initialize variable lastSyncType in AddElementDataSubscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
botder committed Oct 4, 2021
1 parent f99b4a1 commit ca3b0b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Expand Up @@ -949,10 +949,10 @@ bool CStaticFunctionDefinitions::AddElementDataSubscriber(CElement* pElement, co
assert(szName);
assert(pPlayer);

ESyncType lastSyncType;
ESyncType lastSyncType = ESyncType::LOCAL;
CLuaArgument* pCurrentVariable = pElement->GetCustomData(szName, false, &lastSyncType);

if (lastSyncType == ESyncType::SUBSCRIBE)
if (pCurrentVariable != nullptr && lastSyncType == ESyncType::SUBSCRIBE)
{
if (!pPlayer->SubscribeElementData(pElement, szName))
return false;
Expand Down

0 comments on commit ca3b0b7

Please sign in to comment.