diff --git a/Source/controls/plrctrls.cpp b/Source/controls/plrctrls.cpp index 19bbf10d458..aba2e782e43 100644 --- a/Source/controls/plrctrls.cpp +++ b/Source/controls/plrctrls.cpp @@ -221,6 +221,8 @@ void CheckTownersNearby() int distance = GetDistance(Towners[i].position, 2); if (distance == 0) continue; + if (!IsTownerPresent(Towners[i]._ttype)) + continue; pcursmonst = i; } } diff --git a/Source/towners.h b/Source/towners.h index 1788f53a155..00f3a69d44b 100644 --- a/Source/towners.h +++ b/Source/towners.h @@ -72,7 +72,8 @@ struct Towner { }; extern Towner Towners[NUM_TOWNERS]; -/** +bool IsTownerPresent(_talker_id npc); + /** * @brief Maps from a _talker_id value to a pointer to the Towner object, if they have been initialised * @param type enum constant identifying the towner * @return Pointer to the Towner or nullptr if they are not available