Skip to content

Commit 95d207b

Browse files
Synchronize changes from 1.6 master branch [ci skip]
9af03b3 Fix elements sometimes being visible from other dimensions in the current dimension (#4184)
2 parents 16198bc + 9af03b3 commit 95d207b

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

Client/mods/deathmatch/logic/CClientStreamElement.cpp

+14-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void CClientStreamElement::InternalStreamIn(bool bInstantly)
6161
}
6262
}
6363

64-
void CClientStreamElement::InternalStreamOut()
64+
void CClientStreamElement::InternalStreamOut(bool ignoreSendingEvent)
6565
{
6666
if (m_bStreamedIn)
6767
{
@@ -83,13 +83,24 @@ void CClientStreamElement::InternalStreamOut()
8383
}
8484
}
8585

86-
CLuaArguments Arguments;
87-
CallEvent("onClientElementStreamOut", Arguments, true);
86+
if (!ignoreSendingEvent)
87+
{
88+
CLuaArguments Arguments;
89+
CallEvent("onClientElementStreamOut", Arguments, true);
90+
}
8891
}
8992
}
9093

9194
void CClientStreamElement::NotifyCreate()
9295
{
96+
// If the dimensions are different, stream out and do not continue
97+
if (GetDimension() != m_pStreamer->m_usDimension)
98+
{
99+
m_bStreamedIn = true; // InternalStreamOut need it
100+
InternalStreamOut(true);
101+
return;
102+
}
103+
93104
// Update common atrributes
94105
if (!m_bDoubleSidedInit)
95106
m_bDoubleSided = IsDoubleSided();

Client/mods/deathmatch/logic/CClientStreamElement.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CClientStreamElement : public CClientEntity
3030
CClientStreamSector* GetStreamSector() { return m_pStreamSector; }
3131
bool IsStreamedIn() { return m_bStreamedIn; }
3232
void InternalStreamIn(bool bInstantly);
33-
void InternalStreamOut();
33+
void InternalStreamOut(bool ignoreSendingEvent = false);
3434
virtual void StreamIn(bool bInstantly) = 0;
3535
virtual void StreamOut() = 0;
3636
virtual void NotifyCreate();

0 commit comments

Comments
 (0)