From f3262a47c02334ffcd8f78ce54dac22aa85ad149 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Mon, 16 Oct 2023 01:42:01 +0200 Subject: [PATCH] Update client/adventureMap/CList.cpp Co-authored-by: Nordsoft91 --- client/adventureMap/CList.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/adventureMap/CList.cpp b/client/adventureMap/CList.cpp index 3216b6c1b..5beb69402 100644 --- a/client/adventureMap/CList.cpp +++ b/client/adventureMap/CList.cpp @@ -374,10 +374,10 @@ void CTownList::CTownItem::gesture(bool on, const Point & initialPosition, const if(!on) return; - if(!LOCPLINT->localState->getOwnedTowns()[townPos]) - return; - const std::vector towns = LOCPLINT->localState->getOwnedTowns(); + + if(townPos < 0 || townPos > towns.size() - 1 || !towns[townPos]) + return; if(towns.size() < 2) return;