greenheartgames / greenworks

a node.js plugin to integrate nw.js/electron games with steamworks
MIT License
1.49k stars 153 forks source link

ShowFloatingGamepadTextInput incorrectly checks if the 5th arg is a String instead of an Int32, resulting in a "bad arguments" error when attempting to call. #333

Closed MelvorIdle closed 2 weeks ago

MelvorIdle commented 3 weeks ago

Thank you for the implementation of this API.

Unfortunately, ShowFloatingGamepadTextInput incorrectly checks if the 5th arg is a String instead of an Int32, resulting in a "bad arguments" error when attempting to call.

Code in question: src/api/steam_api_utils.cc

NAN_METHOD(ShowFloatingGamepadTextInput) {
  Nan::HandleScope scope;
  if (info.Length() < 5 || !info[0]->IsInt32() || !info[1]->IsInt32() ||
      !info[2]->IsInt32() || !info[3]->IsInt32() || !info[4]->IsString()) {
    THROW_BAD_ARGS("Bad arguments");
  }

I believe !info[4]->IsString()) should instead be !info[4]->IsInt32())

hokein commented 2 weeks ago

Good catch, thanks!