Merge pull request #6974 from Robyt3/Client-Goto-Tele-Crash-Fix

Fix crash when using `goto_tele` in map without tele layer
This commit is contained in:
Dennis Felsing 2023-08-06 22:02:11 +00:00 committed by GitHub
commit ac558b0d34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -256,6 +256,9 @@ void CCamera::SetView(ivec2 Pos)
void CCamera::GotoSwitch(int Number, int Offset)
{
if(Collision()->SwitchLayer() == nullptr)
return;
int Match = -1;
ivec2 MatchPos = ivec2(-1, -1);
@ -297,6 +300,9 @@ void CCamera::GotoSwitch(int Number, int Offset)
void CCamera::GotoTele(int Number, int Offset)
{
if(Collision()->TeleLayer() == nullptr)
return;
int Match = -1;
ivec2 MatchPos = ivec2(-1, -1);