diff --git a/Source/controls/plrctrls.cpp b/Source/controls/plrctrls.cpp index 19bbf10d4..aba2e782e 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 1788f53a1..3dc10026d 100644 --- a/Source/towners.h +++ b/Source/towners.h @@ -72,6 +72,7 @@ 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