A common anti-pattern for determining whether or not we are the only person in an Age is to check the player list returned by PtGetPlayerList(). Generally, if this list is empty, some initialization to a default state is done or some restoration work is done if it is not empty. What the gameplay programmers seem to have not realized, though, is that the list returned by PtGetPlayerList()omits any players that are in your ignore list. Therefore, the wrong initialization path may be executed if there are players in the Age, but all of them are in your ignore list. This could have consequences that range from odd but amusing to catastrophic, depending on the script in question.
Therefore, we fix this problem by introducing PtIsSolo(), which tells us whether or not we are the only player in the Age. This function is not vulnerable to ignore shennanigans, and we avoid creating lots of temporary ptPlayer objects that we don't actually care about.
A common anti-pattern for determining whether or not we are the only person in an Age is to check the player list returned by
PtGetPlayerList()
. Generally, if this list is empty, some initialization to a default state is done or some restoration work is done if it is not empty. What the gameplay programmers seem to have not realized, though, is that the list returned byPtGetPlayerList()
omits any players that are in your ignore list. Therefore, the wrong initialization path may be executed if there are players in the Age, but all of them are in your ignore list. This could have consequences that range from odd but amusing to catastrophic, depending on the script in question.Therefore, we fix this problem by introducing
PtIsSolo()
, which tells us whether or not we are the only player in the Age. This function is not vulnerable to ignore shennanigans, and we avoid creating lots of temporaryptPlayer
objects that we don't actually care about.