ID:94150
 
Not a bug
BYOND Version:464
Operating System:Windows XP Pro
Web Browser:Chrome 5.0.342.9
Applies to:DM Language
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:

DblClick() calls Click() twice.

Numbered Steps to Reproduce Problem:

1. Create a test project with code snippet(provided below), and with a default map

2. Double click something, notice that Click() is also called

Code Snippet (if applicable) to Reproduce Problem:

client/Click(atom/A, control)
world << "[world.time] [src] clicked [A] ([control])!"
client/DblClick(atom/A, control)
world << "[world.time] [src] double-clicked [A] ([control])!"


Expected Results:

Click would not be called when double clicking

"19 ANiChowy double-clicked the blah (the blah)!"

Actual Results:

Click is called twice when double clicking

"18 ANiChowy clicked the blah (the blah)!
19 ANiChowy double-clicked the blah (the blah)!
20 ANiChowy clicked the blah (map)!"

Does the problem occur:

Every time? Or how often? Every time

In other games? Keeth tested it as well on his machine

In other user accounts? Appears so.

On other computers? Appears so.

When does the problem NOT occur?

Never

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?

I believe not

Workarounds:

None to my knowledge, besides adding ridiculous timers and junk.
Just to clarify, I created a completely new project (BYOND version 464.1066) with the following content (plus I set the map to text mode and defined the mob type so I could place it on the map. just a single line containing "mob"):

client
Click(atom/a)
world << "[src] clicked [a]"

DblClick(atom/a)
world << "[src] double-clicked [a]"


And the result is the same as what ANiChowy has here. Though I'm assuming DblClick() is not calling Click(), more that the thing monitoring the clicking is simply calling Click() any time a clicking action is occuring (where it would normally simply call DblClick on two simultaneous clicks).
This is known and actually intentional behavior. There are ways to work around it which have been discussed on the forums before, but it can't be changed without breaking existing games.
Perhaps you can implement a setting that tells BYOND to not call Click() when calling DblClick()? I can't see any game that uses DblClick() and Click() for separate actions expecting Click() to be called when double-clicking. In addition to being convenient, it would help newer porgrammers or people who don't want to use sleep() and stuff for a workaround.