Skip to content

fed bank need some rework #690

Closed
Closed
@ghost

Description

branch: master
commit: 86f766e

Sorry for not follow issue template this time, but it's to follow for this topic.

So I continued testing with my friends and we tested robbing the bank (I set required cops to 1 for testing). As I also wanted to test the bomb defusal one of us planted the bomb, I defused it, and the bomb was replanted. While the timer still had about 2m to go suddenly the explosion triggered and the safe was opened.
After digging through the involved files I suspect this to be the issue:
File: life_server/Functions/Systems/fn_handleBlastingCharge.sqf

private ["_bomb","_time"];
_time = time + (5 * 60);
waitUntil{(round(_time - time) < 1)};
sleep 0.9;
if (!(fed_bank getVariable["chargeplaced",false])) exitWith {};

_bomb = "Bo_GBU12_LGB_MI10" createVehicle [getPosATL fed_bank select 0, getPosATL fed_bank select 1, (getPosATL fed_bank select 2)+0.5];
fed_bank setVariable ["chargeplaced",false,true];
fed_bank setVariable ["safe_open",true,true];

The issue is this:
The timer gets started when the first bomb is planted. It ticks down for the full 5m no matter what else happen on the server. After the 5m is done then it's checked again if in that very moment any bomb is planted, no matter if it's the same or another as the original was defused. If at least some bomb is planted when the first timer hits 0 the explosion is triggered, any other bomb is "disarmed" (so their timers just run out without anything else happening) and the vault is opened.
We didn't tested it, but I suspect that with good timing and a bit of the help of at least one of the cops the bank maybe can be looted twice within that 5m timer interval; although it would require some precise timing and planing. Maybe subject for another test.

How can this be fixed: I'm not sure how well the ArmA3 engine can be manipulated while waiting for something to happen in a not-so-resource-impacting-style, but if possible the timer should be somehow "aborted" when the bomb is defused. Maybe extending the condition to something like this:
waitUntil{(round(_time - time) < 1)||(fed_bank getVariable["chargeplaced",false])};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions