OpenXcom Forum

OpenXcom Forks => OXCE Bugs => OpenXcom Extended (OXCE) => OXCE Bugs FIXED => Topic started by: Xilmi on April 13, 2024, 01:45:51 pm

Title: [FIXED] Exploitable bug in TileEngine::unitOpensDoor
Post by: Xilmi on April 13, 2024, 01:45:51 pm
This issue was brought up to me by the streamer https://www.twitch.tv/dasrifftierchen

And since I could reproduce it in regular OXCE and not just my fork, I thought I better bring it up here.

The bug works as follows:

When a unit with reserved time-units tries to right-click-open a door while doing so would exceed the reserved time-units, the door will still get opened.
However, the time-units will not be spent, the vision will not be updated and the door-opening-sound will not be played.

This is because in TileEngine::unitOpensDoor the function tile->openDoor is called before _save->getBattleGame()->checkReservedTU.

I think TileEngine::unitOpensDoor needs a bit of restructuring to fix this issue.

I attached a screenshot and a save with the situation prepared for testing.
Title: Re: Exploitable bug in TileEngine::unitOpensDoor
Post by: Xilmi on May 27, 2024, 10:57:17 pm
Fixed it now in my branch. The issue was caused by kneeling being also reserved. The TUs reserved for shooting were already considered before the door would open. But not the TUs reserved for kneeling.
Title: Re: Exploitable bug in TileEngine::unitOpensDoor
Post by: Yankes on May 27, 2024, 11:08:38 pm
Could you link commit that fix it?
Title: Re: Exploitable bug in TileEngine::unitOpensDoor
Post by: psavola on May 28, 2024, 05:17:55 am
I suppose it's this one: https://github.com/Xilmi/OpenXcom/commit/bc65e117185b68d2679814cae111e9250d083f83
Title: Re: [FIXED] Exploitable bug in TileEngine::unitOpensDoor
Post by: Meridian on January 26, 2025, 06:51:02 pm
Fixed.

https://github.com/MeridianOXC/OpenXcom/commit/9b7f01b66ffbe4082a4ef833d53785213d45fe09