View Issue Details

IDProjectCategoryView StatusLast Update
0002424The Dark ModGUIpublic03.06.2011 03:58
Reportereigenface Assigned Totels  
PrioritynormalSeveritynormalReproducibilityalways
Status closedResolutionfixed 
PlatformWin64OSWindowsOS Version7
Product VersionTDM 1.02 
Target VersionTDM 1.03Fixed in VersionTDM 1.03 
Summary0002424: click in menu causes game action
DescriptionThe last time you click in the menu, it can count as a click in the game also.
Steps To ReproduceIf you enter the menu with your blackjack selected and then click 'resume game', when you resume you'll immediately swing your blackjack.
TagsNo tags attached.

Activities

solarsplace

solarsplace

17.11.2010 13:47

reporter   ~0003298

Hi

I'm taking a look into this. Thanks.
solarsplace

solarsplace

18.11.2010 20:34

reporter   ~0003299

Am able to consistently reproduce the issue.

Have debugged the code and understand what 'seems' to be happening.

Basically in when one clicks 'resume' from the main menu with mouse button (attack) there is no transition, no pause and reset of the buttons state.

The effect of which is in player.cpp -> Weapon_Combat() -> approx line 3691 where the call to FireWeapon is made immediatly.

What needs to happen is post click of 'resume' mouse button attack state needs to pass through a release and the press process in order to trigger again.

Now in process of working out why this does not happen....
tels

tels

19.11.2010 07:21

reporter   ~0003300

I guess this piece of code gets called:

                if ( ( usercmd.buttons & BUTTON_ATTACK ) && !weaponGone ) {
                        FireWeapon();
? Looking at the code, it might be hard to detct that the BUTTON_ATTACK came from the menu and when we are in this routine, that the menu was just closed.

I see two basic ways to fix this:

* in the menu, stop the button to propagate (this might be hard)
* in the menu (GUI), set a variable/c_var that tells "heh, this button was just clicked but inside the GUI". We technially need only do this for the "Resume game" button. Then the C++ code can check that variable and if true, reset it to false and ignore the click.

But you are probably onto this already :) Just trying to give some hints.
solarsplace

solarsplace

19.11.2010 13:17

reporter   ~0003310

Last edited: 20.11.2010 13:19

Tested as fix successful. Sent PM to Tels.

game_local.h

    435:

    // Solarsplace 19th Nov 2010 - Bug tracker id 0002424
    bool mainMenuExitHasDisabledAttack;
    
game_local.cpp

    224:
    
    // Solarsplace 19th Nov 2010 - Bug tracker id 0002424
    mainMenuExitHasDisabledAttack = false;
    
game_local.cpp

    3454:
    
    // Solarsplace 19th Nov 2010 - Bug tracker id 0002424
    mainMenuExitHasDisabledAttack = true;
    
player.cpp

    7084:

*** This must be added just after these lines:

// grab out usercmd
    usercmd_t oldCmd = usercmd;
    usercmd = gameLocal.usercmds[ entityNumber ];
    buttonMask &= usercmd.buttons;
    usercmd.buttons &= ~buttonMask;
    
    // Solarsplace 19th Nov 2010 - Bug tracker id 0002424
    bool allowAttack = false;
    if ( gameLocal.mainMenuExitHasDisabledAttack && ( usercmd.buttons & BUTTON_ATTACK ) )
    {
        allowAttack = false;
    }
    else
    {
        allowAttack = true;
        gameLocal.mainMenuExitHasDisabledAttack = false;
    }
    
player.cpp

    7259:
    
    // Solarsplace 19th Nov 2010 - Bug tracker id 0002424 - Addition to existing condition
    if (frobbedEnt != NULL && usercmd.buttons & BUTTON_ATTACK && !(oldButtons & BUTTON_ATTACK) && allowAttack)
    
    7279:
    
    // Solarsplace 19th Nov 2010 - Bug tracker id 0002424 - Addition to existing condition
    } else if ( health > 0 && allowAttack) {

Springheel

Springheel

21.11.2010 00:55

administrator   ~0003315

Cool. I've been busted a few times because of this one.
tels

tels

26.11.2010 09:44

reporter   ~0003324

Should be fixed with revison 0004333. Thank you Solarsplace!

Issue History

Date Modified Username Field Change
15.11.2010 12:18 eigenface New Issue
17.11.2010 13:47 solarsplace Note Added: 0003298
17.11.2010 16:17 greebo Status new => assigned
18.11.2010 20:34 solarsplace Note Added: 0003299
19.11.2010 07:21 tels Note Added: 0003300
19.11.2010 13:17 solarsplace Note Added: 0003310
20.11.2010 13:18 solarsplace Note Edited: 0003310
20.11.2010 13:19 solarsplace Note Edited: 0003310
21.11.2010 00:55 Springheel Note Added: 0003315
26.11.2010 09:37 tels Target Version => TDM 1.03
26.11.2010 09:44 tels Note Added: 0003324
26.11.2010 09:44 tels Status assigned => resolved
26.11.2010 09:44 tels Fixed in Version => TDM 1.03
26.11.2010 09:44 tels Resolution open => fixed
26.11.2010 09:44 tels Assigned To => tels
03.06.2011 03:58 greebo Status resolved => closed