Engine-side bug: Input.Mouse.buttonUp set while Input.Mouse.buttons is not

Yare

Professional Game Developer
Member
Joined
Sep 30, 2018
Messages
7
Reaction score
4
First Language
English
Primarily Uses
VNM
Reposting this from the Steam discussion boards for visibility.

There's a bug in VNM's engine-side input handling code that occasionally causes clicks to get lost. In Component_InputHandler.update:

Code:
//...
if Input.Mouse.buttonUp
    console.log("click")       
    gs.GlobalEventManager.emit("mouseUp")
//...

This works as expected. Every left-click gets logged to the console. However, if you also log the button status...

Code:
//...
if Input.Mouse.buttonUp
    console.log("click")     
    console.log(Input.Mouse.buttons) 
    gs.GlobalEventManager.emit("mouseUp")
//...

You'll see that something is broken engine-side. Click repeatedly and most of your logs will correctly show [0,2,0,0] in the console. But occasionally you'll see [0,0,0,0] reported even though Input.Mouse.buttonUp was true on the previous line. This causes issues in numerous systems such as hotspots and choice buttons, where the code listening for the "mouseUp" event gets triggered, but when the code checks against Input.Mouse.buttons[Input.Mouse.BUTTON_LEFT] to make sure the correct button was generating the mouseUp, it fails.
 

Kentou

Admin
Admin
Joined
Jan 20, 2014
Messages
248
Reaction score
68
Hello Yare, thanks for reporting. I will take a look into that soon and let you know if that is an actual bug or by purpose.
 

Yare

Professional Game Developer
Member
Joined
Sep 30, 2018
Messages
7
Reaction score
4
First Language
English
Primarily Uses
VNM
Thank you for looking into this.
 

Latest Threads

Latest Profile Posts

World Domination
And today we got some insides maps from the town i posted last time.

Map044.png
Map045.png
Map046.png
Map047.png Map048.png Map049.png Map050.png
So a big bug that was on a glue trap at home is now magically not on the glue trap. This feeling of terror I'm experiencing could be a fun thing to put in my game project (not the IGMC one).
Hoping that Unite has a character generator with black hairs/lips and other features.. it is such a pain making characters without these...
Today is my dad's birthday! And he's still going strong in his retirement days!

Forum statistics

Threads
123,394
Messages
1,156,255
Members
161,850
Latest member
cyk070428
Top