Talk:Sandstone Brick Wall

From Terraria Wiki
Jump to navigation Jump to search

Oddity when used for npc housing

Just noticed this oddity in the code of TrySpawningTownNPC:

      if ((int) Main.tile[x, y].wall == 34)
      {
        if (Main.rand.Next(4) != 0)
          return;
        int num = (int) WorldGen.SpawnTownNPC(x, y);
      }
      else
      {
        int num1 = (int) WorldGen.SpawnTownNPC(x, y);
      }

Seems like sandstone brick wall, which is perfectly valid wall for a house according to Main.wallHouse[34] = true;, has a 3/4 chance to cause npc spawning to fail. This also affects moving npc from a different house with the housing menu, in which case npc will become homeless, but when game tries to QuickFindHome for homeless npc it doesn't bother with that function, and can assign homeless npc to a sandstone brick wall house without a problem. Probably not trivia or note worthy, but figured it should at least be mentioned on the talk page. 86.115.19.146 11:26, 1 October 2018 (UTC)