Blog
2024.04.26.1
Link
Mar 21, 2024
I need QA / playester man...

I need QA / playtesters man…

There was a bug in the recent Werewolf Moderator rewrite that go unnoticed until yesterday (it only happens when you enter player IDs that has two or more digits)

Before the rewrite player IDs was stored as an array and used the “.includes()” method to check if a player ID is included in the array (as in if the player ID is an element of the array).

The rewrite switch from player IDs being stored as an array to being a comma separated string, which also has a “.includes” method, but this one check if a player ID is included in the string (as in if the player ID is a substring of the string)

This has lead to a bug where when checking if the Guard role can protect a player, Werewolf Moderator might says that the player was protected by the Guard even though it wasn’t.

For example, let’s say Guard is protecting Player ID number 12. Werewolf tries to kill Player ID 2, but since 2 is included in / a substring of 12, Werewolf Moderator will says that Player ID 2 was saved by Guard.

I want to blame JavaScript for having array and string having the same name for two methods that checks differently, but honestly this is just a playtest/QA issue.

It just go to shows that I’m really good at writing code but really bad at testing my own code man…