Skip to content

Commit

Permalink
Merge pull request #201 from zerty/bug-fixing
Browse files Browse the repository at this point in the history
Bug fixing
  • Loading branch information
zerty committed Jun 5, 2018
2 parents dfe6046 + 97a4664 commit 7c65ad9
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 44 deletions.
2 changes: 1 addition & 1 deletion Addons/Strat_mode/Functions/SM_RepairVehicule.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SM_repair_vehicle={
[localize "STR_RepairingVehicle",0,1,0] call HUD_PBar_start;

["CLIENT", "Repair_vehicle",[_target,_caller,_pos],true] call CTI_CO_FNC_NetSend;

["SERVER", "Repair_vehicle",[_target,_caller,_pos],true] call CTI_CO_FNC_NetSend;

while {alive _caller && alive _target && _hps > 0 && (_caller distance2d _target) <5 && (_caller distance _target) <7 && (_caller distance _pos)<=1 && (vehicle _caller) ==_caller && _currentdamage > ((getdammage _target) - 0.01) && _currentcallerdamage > ((getdammage _caller) - 0.02)} do {
sleep 1;
Expand Down
2 changes: 1 addition & 1 deletion Addons/Strat_mode/REV/REV_act_rev.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sleep 5;
if (isplayer _caller && !((animationstate _caller ) == "AinvPknlMstpSlayWrflDnon_medic")) exitwith {false};
_unit setvariable ["REV_DRAGGED",false,true];
_unit setDamage 0.25;
_unit setVariable ["REV_UNC", false, true];
_unit setVariable ["REV_REQREV", true, true];
9 changes: 5 additions & 4 deletions Addons/Strat_mode/REV/REV_obj_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ diag_log format [":: REV:: trying to handle player as %1", _obj];
waitUntil {! isnull _obj && alive _obj};


_obj setvariable ["REV_UNC",false,true];
_obj setvariable ["REV_DRAGGED",false,true];
_obj setvariable ["REV_DRAGGING",objnull,false];
_obj setvariable ["REV_UNC",false,true]; //unconsious
_obj setvariable ["REV_REQREV",false,true]; // revive requested by action
_obj setvariable ["REV_DRAGGED",false,true]; //dragging diabled for now
_obj setvariable ["REV_DRAGGING",objnull,false]; //dragging diabled for now

_obj addeventhandler["HandleDamage",REV_HANDLER];

_obj addaction ["<t color='#C90000'>Suicide</t>",REV_ACT_SUIC, [], 666, false, true, "", "_this == _target && _target getVariable ['REV_UNC',false]"];
_obj addaction ["<t color='#C90000'>Suicide</t>",REV_ACT_SUIC, [], 666, false, true, "", "_this == _target && _target getVariable ['REV_UNC',true]"];
_obj addaction ["<t color='#C90000'>Revive</t>",REV_ACT_REV, [], 9, false, true, "", "! (isplayer _this) && _target getVariable ['REV_UNC',true]&& (_target distance _this) <100"];//
//_obj addaction ["<t color='#C90000'>Release</t>",REV_ACT_REL, [], 9, false, true, "", "_this == _target && ! (_target getVariable ['REV_UNC',true])&&!(_target getVariable ['REV_DRAGGED',true])&& ! isNull (_this getVariable ['REV_DRAGGING',objNull])"];
4 changes: 2 additions & 2 deletions Addons/Strat_mode/REV/REV_ui_mod.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ private ["_main_disp","_ntime"];


inGameUISetEventHandler ["Action", "
if (_this select 5 != 666 && player getVariable ['REV_UNC',false]) then {
hint 'Sorry, You are down!';
if (round(_this select 5) != 666 && player getVariable ['REV_UNC',false]) then {
hint 'Sorry, You are down! :: %1';
true
}
"];
Expand Down
3 changes: 3 additions & 0 deletions Addons/Strat_mode/REV/REV_unc_loop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ while {(!CTI_GameOver && alive _unit && _unit getVariable ["REV_UNC",false] && t
_unit action ["getOut", (vehicle _unit)];
};
((time- _starting_time) / BLEEDOUT_TIME ) call HUD_PBar_update;
if (_unit getVariable ["REV_REQREV",false]) then {_unit setVariable ["REV_UNC",false,true];}; // revive request has arrived
sleep 0.1;
};
if (! (alive _unit) || CTI_GameOver) exitwith {
if (player == _unit ) then {CTI_P_PreBuilding = false};
player setCaptive false;
_unit setVariable ["REV_UNC", false, true];
_unit setvariable ["REV_REQREV",false,true];
_unit setvariable ["REV_DRAGGED",false,true];
0 call HUD_PBar_stop;
false
Expand All @@ -32,6 +34,7 @@ _unit enableSimulation true;
_unit setDamage 0.25;
_unit setCaptive false;
_unit setVariable ["REV_UNC", false, true];
_unit setvariable ["REV_REQREV",false,true];
_unit setvariable ["REV_DRAGGED",false,true];
if (player == _unit ) then {CTI_P_PreBuilding = false};

Expand Down
4 changes: 2 additions & 2 deletions Rsc/Game.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ respawnDelay = 10;
respawnDialog = false;

//--- Require briefing.html to show up.
onLoadMission = "BECTI - Zerty/HTom/Yoshi_E 1.3.4.0";
onLoadMission = "BECTI - Zerty/HTom/Yoshi_E 1.3.4.1";
onLoadMissionTime = false;
onLoadName = "BECTI - Zerty/HTom/Yoshi_E";

briefingName = "BECTI - Zerty/HTom/Yoshi_E 1.3.4.0";
briefingName = "BECTI - Zerty/HTom/Yoshi_E 1.3.4.1";

//--- ArmA 3 Specifics
dev = "Benny";
Expand Down
80 changes: 56 additions & 24 deletions Server/Functions/Server_HandleStaticDefenses.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,59 @@ while {! CTI_GAMEOVER} do {


{
if ((_x getVariable ["cti_aman_enabled", false])||(_x isKindOf "B_AAA_System_01_F" || _x isKindOf "B_SAM_System_01_F" || _x isKindOf "B_SAM_System_02_F")) then {
if ((_x getVariable ["cti_aman_enabled", false])|| (typeof _x )in ["B_AAA_System_01_F","B_SAM_System_01_F","B_SAM_System_02_F"]) then {
_defense_team = _logic getVariable "cti_defensive_team";
if (_x emptyPositions "gunner" > 0 && alive _x) then {
if (((_x emptyPositions "gunner" > 0)|| (gunner _x ) != (_x getvariable ["CTI_assigned_gunner",objnull]) || ((isnull (_x getvariable ["CTI_assigned_gunner",objnull])) && ! isnull (gunner _x))) && alive _x) then {
_nearest_b = [CTI_BARRACKS, _x, (_side) call CTI_CO_FNC_GetSideStructures, CTI_BASE_DEFENSES_AUTO_REARM_RANGE] call CTI_CO_FNC_GetClosestStructure;
if (!(isnull _nearest_b) && alive _nearest_b) then {
if (isnull (assignedGunner _x) && count(_defense_team call CTI_CO_FNC_GetLiveUnits) < CTI_BASE_DEFENSES_AUTO_LIMIT) then {
if (!(isnull _nearest_b) && alive _nearest_b && (getDammage _x) < 0.4 ) then {
if (isnull (_x getvariable ["CTI_assigned_gunner",objnull]) && count(_defense_team call CTI_CO_FNC_GetLiveUnits) < CTI_BASE_DEFENSES_AUTO_LIMIT) then {
_var = missionNamespace getVariable [format ["CTI_%1_%2", _side, _nearest_b getVariable "cti_structure_type"],[[0,"Town"],0,0,0,[0,0]]];
_direction = 360 - ((_var select 4) select 0);
_distance = (_var select 4) select 1;
_position = _nearest_b modelToWorld [(sin _direction * _distance), (cos _direction * _distance), 0];
if ( isNull _defense_team) then {_defense_team = createGroup _side; _logic setVariable ["cti_defensive_team",_defense_team,true];};
_ai = [missionNamespace getVariable format["CTI_%1_Soldier", _side], _defense_team, _position, _sideID, _net] call CTI_CO_FNC_CreateUnit;
[_ai] allowGetIn true;
_ai assignAsGunner _x;
_x setVariable ["CTI_assigned_gunner_time",time,false];
[_ai] orderGetIn true;
_defense_team setBehaviour "AWARE";
_defense_team setCombatMode "RED";
_defense_team setSpeedMode "FULL";
diag_log format [":: DEF NG :: creating crew for %1 of side %2 at time %3 : %4", _x,_side,(_x getVariable ["CTI_assigned_gunner_time",0]),_ai];

if ((typeof _x )in ["B_AAA_System_01_F","B_SAM_System_01_F","B_SAM_System_02_F"] ) then {
if (isnull (gunner _x) || !alive (gunner _x)) then {
_x deleteVehicleCrew ( gunner _x);
createVehicleCrew _x;
_x joinAsSilent [createGroup _side, 99];
(group _x) setBehaviour "COMBAT";
(group _x) setCombatMode "RED";
_x setVehicleRadar 1;
_x setVehicleLock "LOCKED";
diag_log format [":: DEF NG :: creating crew for %1 of side %2 at time %3 ", _x,_side,(_x getVariable ["CTI_assigned_gunner_time",0])];
};
} else {
if ( isNull _defense_team) then {_defense_team = createGroup _side; _logic setVariable ["cti_defensive_team",_defense_team,true];};
_ai = [missionNamespace getVariable format["CTI_%1_Soldier", _side], _defense_team, _position, _sideID, _net] call CTI_CO_FNC_CreateUnit;
[_ai] allowGetIn true;
_ai assignAsGunner _x;
_ai setvariable ["CTI_assigned_def",_x,false];
_x setvariable ["CTI_assigned_gunner",_ai,false];
_x setVariable ["CTI_assigned_gunner_time",time,false];
[_ai] orderGetIn true;
_defense_team setBehaviour "AWARE";
_defense_team setCombatMode "RED";
_defense_team setSpeedMode "FULL";
diag_log format [":: DEF NG :: creating crew for %1 of side %2 at time %3 : %4", _x,_side,(_x getVariable ["CTI_assigned_gunner_time",0]),_ai];
};

} else {
if (!(isnull (assignedGunner _x)) &&alive (assignedGunner _x)) then {
if (!(isnull (_x getvariable ["CTI_assigned_gunner",objnull])) && alive (_x getvariable ["CTI_assigned_gunner",objnull])) then {
if (time > ((_x getVariable ["CTI_assigned_gunner_time",0])+_man_timeout)) then {
diag_log format [":: DEF NG :: Moving late crew for %1 of side %2 expected at %3 (rt: %4) : %5", _x,_side,((_x getVariable ["CTI_assigned_gunner_time",0])+_man_timeout),time,(assignedGunner _x)];
(assignedGunner _x) moveInGunner _x;
diag_log format [":: DEF NG :: Moving late crew for %1 of side %2 expected at %3 (rt: %4) : %5", _x,_side,((_x getVariable ["CTI_assigned_gunner_time",0])+_man_timeout),time,(_x getvariable ["CTI_assigned_gunner",objnull])];
moveout (gunner _x);
(_x getvariable ["CTI_assigned_gunner",objnull]) moveInGunner _x;
} else {
[(_x getvariable ["CTI_assigned_gunner",objnull])] allowGetIn true;
(_x getvariable ["CTI_assigned_gunner",objnull]) assignAsGunner _x;
[(_x getvariable ["CTI_assigned_gunner",objnull])] orderGetIn true;
};
} else {
if (!(isnull (assignedGunner _x))) then {
diag_log format [":: DEF NG :: deleting dead crew for %1 of side %2 : %3", _x,_side,(assignedGunner _x)];
deleteVehicle (assignedGunner _x);
objnull assignAsGunner _x;
if (!(isnull (_x getvariable ["CTI_assigned_gunner",objnull]))) then {
diag_log format [":: DEF NG :: deleting dead crew for %1 of side %2 : %3", _x,_side,(_x getvariable ["CTI_assigned_gunner",objnull])];
deleteVehicle (_x getvariable ["CTI_assigned_gunner",objnull]);
_x setvariable ["CTI_assigned_gunner",objnull,false];
_x setVariable ["CTI_assigned_gunner_time",-1,false];
};
};
Expand All @@ -89,12 +111,22 @@ while {! CTI_GAMEOVER} do {
_nearest = [CTI_AMMO, _x, (_side) call CTI_CO_FNC_GetSideStructures, CTI_BASE_DEFENSES_AUTO_REARM_RANGE] call CTI_CO_FNC_GetClosestStructure;

if (count _ammo_trucks > 0 || (!isNull _nearest && alive _nearest)) then {
_x setVehicleAmmoDef 1;
diag_log format [":: DEF NG :: %1 of side %2 rearmed", _x,_side];
if ((gunner _x) == (_x getvariable ["CTI_assigned_gunner",objnull]) || (typeof _x )in ["B_AAA_System_01_F","B_SAM_System_01_F","B_SAM_System_02_F"]) then {
_x setVehicleAmmoDef 1;
diag_log format [":: DEF NG :: %1 of side %2 rearmed", _x,_side];
};
};
};
};
} forEach _defs;


_defense_team = _logic getVariable "cti_defensive_team";
if !(isnull _defense_team) then {
{
if (isnull (_x getVariable ["CTI_assigned_def",objNull]) || (!alive (_x getVariable ["CTI_assigned_def",objNull])) || ( getDammage (_x getVariable ["CTI_assigned_def",objNull]) >= 0.4 ) ) then {deleteVehicle _x;};
} forEach (units _defense_team);
};

sleep 60;
};
};
Binary file modified banner.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 11 additions & 10 deletions mission.sqm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class EditorData
pos[]={2450.3237,25.100098,9116.7275};
dir[]={0,-0.70710683,0.70710683};
up[]={0,0.70710677,0.70710677};
aside[]={0.99999994,0,-0};
aside[]={0.99999994,0,0};
};
};
binarizationWanted=0;
Expand Down Expand Up @@ -105,7 +105,7 @@ class Mission
{
class Intel
{
briefingName="BECTI - Zerty/HTom/Yoshi_E 1.3.4.0";
briefingName="BECTI BE 0.97 - Zerty 1.3.4.1";
overviewText="By Benny - Adapted from OFP era MFCTI (Mike Melvin)";
resistanceWest=0;
timeOfChanges=24720;
Expand Down Expand Up @@ -2017,6 +2017,7 @@ class Mission
};
id=127;
type="O_Soldier_SL_F";
atlOffset=4.7683716e-007;
};
class Item14
{
Expand Down Expand Up @@ -2109,7 +2110,7 @@ class Mission
};
id=132;
type="O_Soldier_SL_F";
atlOffset=2.7273612;
atlOffset=2.7273622;
};
class Item19
{
Expand Down Expand Up @@ -2163,7 +2164,7 @@ class Mission
};
id=135;
type="O_Soldier_SL_F";
atlOffset=3.6859956;
atlOffset=3.6859965;
};
class Item22
{
Expand All @@ -2181,14 +2182,14 @@ class Mission
};
id=136;
type="O_Soldier_SL_F";
atlOffset=2.4978232;
atlOffset=2.4978242;
};
class Item23
{
dataType="Object";
class PositionInfo
{
position[]={14512.12,9.7627974,5843.0957};
position[]={14512.12,9.7627964,5843.0957};
};
side="East";
class Attributes
Expand Down Expand Up @@ -2217,7 +2218,7 @@ class Mission
};
id=138;
type="O_Soldier_SL_F";
atlOffset=3.7724271;
atlOffset=3.772428;
};
};
class Attributes
Expand Down Expand Up @@ -2503,7 +2504,7 @@ class Mission
};
id=151;
type="B_Soldier_SL_F";
atlOffset=1.9073486e-006;
atlOffset=3.8146973e-006;
};
class Item12
{
Expand Down Expand Up @@ -2540,7 +2541,7 @@ class Mission
};
id=153;
type="B_Soldier_SL_F";
atlOffset=2.7794733;
atlOffset=2.7794752;
};
class Item14
{
Expand Down Expand Up @@ -2633,7 +2634,7 @@ class Mission
};
id=158;
type="B_Soldier_SL_F";
atlOffset=2.4224777;
atlOffset=2.4224787;
};
class Item19
{
Expand Down

0 comments on commit 7c65ad9

Please sign in to comment.