MantisBT - VCMI
View Issue Details
0001582VCMIGUI - Battlespublic2013-11-02 18:472014-06-02 09:07
beegee 
beegee 
highmajoralways
closedfixed 
0.94 
0.94b 
0001582: Can't open spellbook in hotseat mode
In hotseat mode player B can not open the spellbook if player A has used a spell.
1. Hotseat game
2. Player A attacks player B (both human)
3. Player A uses a spell
4. Player B can't open the spellbook because the button is disabled

After the next round the issue can be repeated. Player B can also "disable" the spellbook for player A.
- Player A used a spell. The spellbook button for Player A is not disabled anymore when the next stack of Player A gets selected. If you click on the button the spellbook screen won't be opened. The button should be disabled.
No tags attached.
has duplicate 0001571closed beegee The book of spells in the hot SEAT mode 
Issue History
2013-11-02 18:47beegeeNew Issue
2013-11-02 18:48beegeeNote Added: 0004101
2013-11-02 19:26IvanNote Added: 0004102
2013-11-02 19:49beegeeNote Added: 0004103
2013-11-02 19:49beegeeNote Edited: 0004103bug_revision_view_page.php?bugnote_id=4103#r2429
2013-11-02 20:00beegeeNote Added: 0004104
2013-11-02 20:07beegeeNote Added: 0004105
2013-11-02 20:09beegeeNote Added: 0004106
2013-11-02 20:09beegeeStatusnew => resolved
2013-11-02 20:09beegeeFixed in Version => 0.94b
2013-11-02 20:09beegeeResolutionopen => fixed
2013-11-02 20:09beegeeAssigned To => beegee
2013-11-02 20:09beegeeNote Deleted: 0004105
2013-11-02 21:58PovelitelNote Added: 0004107
2013-11-03 14:44beegeeRelationship addedhas duplicate 0001571
2013-11-03 14:49beegeeNote Added: 0004109
2014-06-01 18:13KantorNote Added: 0004677
2014-06-02 09:07KantorStatusresolved => closed

Notes
(0004101)
beegee   
2013-11-02 18:48   
I will try to fix this bug.
(0004102)
Ivan   
2013-11-02 19:26   
Right now there is a function in battle interface that:
1) should be called whenever there may be change into buttons status
2) should correctly change state of all buttons.

Probably one of these statements is not valid for spellbook button.
(0004103)
beegee   
2013-11-02 19:49   
The function blockUI which updates buttons of the battle interface gets spell casting information of the old player.

bool canCastSpells = curInt->cb->battleCanCastSpell(&spellcastingProblem);

The variable curInt points to the old player when the blockUI method is invoked during the stack activation phase of the new player.

Any ideas how to fix this? curInt is a public member of the battle interface :(

(0004104)
beegee   
2013-11-02 20:00   
setActiveStack(stackToActivate);
    stackToActivate = nullptr;
    const CStack *s = activeStack;

    myTurn = true;
    if(!!attackerInt && defenderInt) //hotseat -> need to pick which interface "takes over" as active
        curInt = attackerInt->playerID == s->owner ? attackerInt : defenderInt;


The curInt reassignment should be moved before the setActiveStack method call. I don't know if activateStack is the correct place for setting the curInt variable, but it seems to be.
(0004106)
beegee   
2013-11-02 20:09   
Fixed in Revision 3600.
(0004107)
Povelitel   
2013-11-02 21:58   
It seems, it is a similar problem. Or I am mistaken?
http://bugs.vcmi.eu/view.php?id=1571 [^]
(0004109)
beegee   
2013-11-03 14:49   
Yes, it belongs to the same problem. I closed mantis 1571 and marked it as a duplicate of this issue. Thanks for your information, I didn't search for any open mantis point related to that problem :(
(0004677)
Kantor   
2014-06-01 18:13   
This one may be closed.