mbkarle / mind-the-fog

Roguelike JavaScript game--mind the fog!
2 stars 1 forks source link

Dog Fog Bug #116

Closed akarle closed 6 years ago

akarle commented 6 years ago

It seems that in the current stable game, when you switch rooms, the spot the dog was in does not get given fog in the new room.

akarle commented 6 years ago

Just tested in branch at commit cc9e7e4107b9cebadc420a68632c3aac6c1e616f , this was a bug before the division of dungAdv #115

akarle commented 6 years ago

Simple fix. The problem was that the dog was spawned after the buildRoomHTML.

Now, for a refresher:

  1. buildRoomHTML places fog on everything not in hero sight
  2. spawn_dog moves the dog to a spot next to the hero, BUT in moving it, it refreshes the html of the old position to whatever it should be (note that this updates the html, thus breaking the fog).