Cherry-picked from main (5028355) with conflict resolution. Changes condition from && to || to properly handle the case where a player has a guild but also has a prevGuildID set.
5028355