Author Topic: help me find these damn bugs.  (Read 4309 times)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
help me find these damn bugs.
« on: October 30, 2013, 07:18:54 pm »
so, there's a few issues on the bug tracker that are doing my head in, because i'm completely unable to reproduce them, so i figure i'll appeal to the wider community to help track these ones down. any saved games exhibiting the issue, or videos, or images, or extremely detailed descriptions would be very much appreciated.

importantly: make sure you're using the absolute latest nightly build.

Quote
351: Arbitrary countries mentioned in council report

Issue description
My last monthly report stated that the USA and India had signed a secret pact with the aliens and withdrawn from the project. The USA was a new casualty, but India had signed a pact months ago. There had been other countries that signed a pact before and after India. I can understand the USA being mentioned in the report, but why India and not others? I've seen the same thing happen in previous months, too.

now, i've read and re-read the code concerned here a thousand times, and there's no conceivable logical way this could happen, i don't understand it. if anyone has any information regarding this issue, please let me know.
fixed

Quote
303: "reserve TUs for snap shot" sometimes allows all TUs to be exhausted

Issue description
sometimes TUs won't be reserved when moving or taking actions - no warning appears until the unit has finished moving or has ran out of TUs (in which case it displays the correct "No More TU" message)

Can be fixed by simply clicking on a different movement type and then clicking back on to "reserve TUs for snap shot"

After a unit reaches his TU reserve but then takes actions to use up additional TU's is when the TU reserve seems to stop applying. The GUI button remains depressed but troops after that seem to stop reserving TU's unless the button is selected again.

again, i can't seem to trigger this or see where the flaw in the logic lies.
« Last Edit: October 31, 2013, 06:36:41 am by Warboy1982 »

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: help me find these damn bugs.
« Reply #1 on: October 31, 2013, 12:22:11 am »
I not found a source of the problem, but I have two questions about Country.cpp code.

https://github.com/SupSuper/OpenXcom/blob/master/src/Savegame/Country.cpp#L57
Why need check _pact and _newPact during loading a game?
Maybe these variables need check only while saving game? And while loading, default value sets to "false" (if node absent).
For example:
Code: [Select]
void Country::load(const YAML::Node &node)
{
        ...
        _pact = node["pact"].as<bool>(false);
        _newPact = node["newPact"].as<bool>(false);
}

YAML::Node Country::save() const
{
        ...
        if (_pact)
            node["pact"] = _pact;
        if (_newPact)
            node["newPact"] = _newPact;
        return node;
}

Next thing.
https://github.com/SupSuper/OpenXcom/blob/master/src/Savegame/Country.cpp#L196
What happens, if _newPact and _pact sets to "true" together?
Flag _newPact will not be reset. Then every month this country will sign a pact.
Maybe need check only _newPack?
Code: [Select]
        if(_newPact)
        {
                _newPact = false;
                _pact = true;
                addActivityAlien(150);
        }
« Last Edit: October 31, 2013, 12:25:00 am by redv »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: help me find these damn bugs.
« Reply #2 on: October 31, 2013, 06:35:17 am »
funnily enough i never checked the save function, that was where the bug was. thanks.

as for the second issue you raised: it would never arise, the only call to the function that sets _newPact to true checks that both _pact and _newPact are false beforehand.

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: help me find these damn bugs.
« Reply #3 on: November 02, 2013, 03:07:26 pm »
again, i can't seem to trigger this or see where the flaw in the logic lies.

I cannot reproduce this bug. Reserve TU works properly. I found only one situation, when reserve TU resets to no reserve.
1. While in BattleScape, go to Options->Game Options.
2. Press the "OK" button. Then reserve TU resets to no reserve.
I don't know, is it bug or is it feature, because in this case created new BattleState.
https://github.com/SupSuper/OpenXcom/blob/master/src/Menu/OptionsBaseState.cpp#L73

I have another explanation.
I own notebook lenovo t530. When runs GeoScape, if i press multimedia button "volume up" (on keyboard), then the game opens BaseScape like if i pressed "b" key. On the other hand, if i try rename base or soldier or if i use (for example) notepad and press the button "volume up", then symbol "b" does not appear.
I tried reassign shortcut of reset reserve TU from "F1" to "b". Then, when i press "volume up", reserve TU was reseted.

So, i assume, the issue appear when player uses uncommon buttons on keyboard or mouse. For example: volume up/down/mute, brightness up/down, track list next/previous/pause etc.
It is easy to verify. Just need reassign shortcut from "F1" to any other key and try to play.