Skip to content

Ensure the get_self_switch is automatically linked to the calling event + fix a behaviour problem

Rey requested to merge TheRey/pokemonsdk:demo/fix_self_switch into development

MR Description

  • This MR adds the @event_id variable as the default for the event_id parameter of get_self_switch. It also fixes a weird problem: currently, when trying to call for the state of a self_switch, if the self_switch was never changed before (with set_self_switch, for example), the user will receive 'nil'. As a local switch is a switch, the only real possibilities are to receive 'true' or 'false'. This MR ensures the user will receive false if 'nil' should have been received.

Tests to realize

  • Create an event with the get_self_switch method. Use it to get the state of any self switch of an event which never had any change to its self switches: you should receive true.
  • Change the state of a self switch of an event, then use the get_self_switch method to get its state: you should receive true or false only.
Edited by Zøzo

Merge request reports