BryanChiu / Mactivision

CS4ZP6 2020-21 Capstone group. Mini-games
4 stars 5 forks source link

String representation of Integer Allowed for DigAmount #99

Closed syed-razi closed 3 years ago

syed-razi commented 3 years ago

Description:

I noticed that setting the DigAmount to a string representation of an integer works just like an integer. This does not seem to be intended from the instructions on editing the configuration file: image

Environment:

Device: Macbook Pro 2015 Browser: Chrome

Steps to Reproduce:

  1. Open Battery.json
  2. Set DigAmount to "10" image
  3. Save file
  4. Start Client and Server
  5. Dig normally

Actual Result:

Digging works similarly to when DigAmount is set using an integer

Expected Result:

I would have expected this to fail or to get some sort of warning, or for the instructions to mention that strings are allowed

Severity: Low

BryanChiu commented 3 years ago

This is working as intended; the game will cast any value to the intended type (in this case the string "10" is cast to a integer 10). If you give "10a" it will fail.