Update BIS Effects and fix eject bug for Cessna

This commit fixes the cessna getOut bug. Sometimes if the cessna explodes and the player did not die he was trapped inside of the cessna wreck. Switching from getOut to eject fixes this problem.
Ive did a lot tests and it should be save to eject instead of getOut.
This commit is contained in:
AirwavesMan
2020-10-31 10:19:27 +01:00
parent 7851663842
commit 0b6df45690
3 changed files with 35 additions and 30 deletions

View File

@@ -1,10 +1,13 @@
private ["_amm"]; if !(isDedicated) then {
_amm=_this select 4; private "_amm";
_this call (call compile GetText (configFile >> "CfgAmmo" >> _amm >> "muzzleEffect"));
//Handle combat in vehicle _amm = _this select 4;
if (player in (crew (_this select 0))) then { _this call (call compile GetText (configFile >> "CfgAmmo" >> _amm >> "muzzleEffect"));
if !(player getVariable ["inCombat",false]) then { //Handle combat in vehicle
player setVariable ["inCombat",true,true]; if (player in (crew (_this select 0))) then {
if !(player getVariable ["inCombat",false]) then {
player setVariable ["inCombat",true,true];
};
player setVariable["combattimeout", diag_tickTime + 30, false];
}; };
player setVariable["combattimeout", diag_tickTime + 30, false]; };
};

View File

@@ -5,7 +5,7 @@ if (isNil "BIS_Effects_Init_DZ") then {
diag_log "Res3tting B!S effects..."; diag_log "Res3tting B!S effects...";
BIS_Effects_EH_Fired=compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\fired.sqf"; // Allows tanks to use smoke counter measures BIS_Effects_EH_Fired=compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\fired.sqf"; // Allows tanks to use smoke counter measures
BIS_Effects_EH_Killed = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\killed.sqf"; BIS_Effects_EH_Killed = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\killed.sqf";
BIS_Effects_Rifle = {false}; BIS_Effects_Rifle = {false};
BIS_Effects_Cannon=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\cannon.sqf"; BIS_Effects_Cannon=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\cannon.sqf";
BIS_Effects_HeavyCaliber=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\heavycaliber.sqf"; BIS_Effects_HeavyCaliber=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\heavycaliber.sqf";
@@ -14,7 +14,7 @@ if (isNil "BIS_Effects_Init_DZ") then {
BIS_Effects_SmokeShell=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\smokeshell.sqf"; BIS_Effects_SmokeShell=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\smokeshell.sqf";
BIS_Effects_SmokeLauncher=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\smokelauncher.sqf"; BIS_Effects_SmokeLauncher=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\smokelauncher.sqf";
BIS_Effects_Flares=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\flares.sqf"; BIS_Effects_Flares=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\flares.sqf";
//must use spawn command for these: //must use spawn command for these:
BIS_Effects_Burn=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf"; BIS_Effects_Burn=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
BIS_Effects_AircraftVapour=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\misc\aircraftvapour.sqf"; BIS_Effects_AircraftVapour=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\misc\aircraftvapour.sqf";
@@ -22,16 +22,16 @@ if (isNil "BIS_Effects_Init_DZ") then {
BIS_Effects_AirDestructionStage2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\AirDestructionStage2.sqf"; BIS_Effects_AirDestructionStage2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\AirDestructionStage2.sqf";
BIS_Effects_Secondaries = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\secondaries.sqf"; BIS_Effects_Secondaries = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\secondaries.sqf";
//BIS_Effects_RocketTrail=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\rockettrail.sqf"; //BIS_Effects_RocketTrail=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\muzzle\rockettrail.sqf";
/////////////////Dwarden fixing fire in the sky bug /////////////////Dwarden fixing fire in the sky bug
BIS_Effects_globalEvent = BIS_Effects_globalEvent =
{ {
BIS_effects_gepv = _this; BIS_effects_gepv = _this;
publicVariable "BIS_effects_gepv"; publicVariable "BIS_effects_gepv";
_this call BIS_Effects_startEvent; _this call BIS_Effects_startEvent;
}; };
BIS_Effects_startEvent = BIS_Effects_startEvent =
{ {
private "_KillEject"; private "_KillEject";
@@ -42,29 +42,32 @@ if (isNil "BIS_Effects_Init_DZ") then {
{ {
if ((isInTraderCity || !canbuild) && {(player distance (_x select 0)) < (_x select 1)}) exitWith {_cancel = true;}; if ((isInTraderCity || !canbuild) && {(player distance (_x select 0)) < (_x select 1)}) exitWith {_cancel = true;};
} count DZE_SafeZonePosArray; } count DZE_SafeZonePosArray;
player action ["getOut", (_this select 0)]; player action ["eject", (_this select 0)];
if (!_cancel && !((_this select 0) iskindof "car")) then { if (!_cancel && !((_this select 0) iskindof "car")) then {
[player, "explosion"] call player_death; [player, "explosion"] call player_death;
}; };
}; };
}; };
switch (_this select 0) do { call {
case "AirDestruction": { private "_state";
[_this select 1] spawn BIS_Effects_AirDestruction;
[_this select 1] call _KillEject; _state = _this select 0;
if (_state == "AirDestruction") exitwith {
[_this select 1] spawn BIS_Effects_AirDestruction;
[_this select 1] call _KillEject;
}; };
case "AirDestructionStage2": { if (_state == "AirDestructionStage2") exitwith {
[_this select 1, _this select 2, _this select 3] spawn BIS_Effects_AirDestructionStage2; [_this select 1, _this select 2, _this select 3] spawn BIS_Effects_AirDestructionStage2;
}; };
case "Burn": { if (_state == "Burn") exitwith {
[_this select 1, _this select 2, _this select 3, false, true] spawn BIS_Effects_Burn; [_this select 1, _this select 2, _this select 3, false, true] spawn BIS_Effects_Burn;
}; };
case "Eject": { if (_state == "Eject") exitwith {
[_this select 1] call _KillEject; [_this select 1] call _KillEject;
}; };
}; };
}; };
"BIS_effects_gepv" addPublicVariableEventHandler { "BIS_effects_gepv" addPublicVariableEventHandler {
if(time <= 0) exitWith {(_this select 1) spawn { //Fire in the sky bug fix if(time <= 0) exitWith {(_this select 1) spawn { //Fire in the sky bug fix
waitUntil {sleep 1; !isNull findDisplay 46}; // Display 46 is indication that client finished loading waitUntil {sleep 1; !isNull findDisplay 46}; // Display 46 is indication that client finished loading
@@ -72,4 +75,4 @@ if (isNil "BIS_Effects_Init_DZ") then {
}}; }};
(_this select 1) call BIS_Effects_startEvent; (_this select 1) call BIS_Effects_startEvent;
}; };
}; };

View File

@@ -1,18 +1,17 @@
private ["_v","_int","_t","_b"]; private ["_v","_int","_isVeh","_b"];
_v=_this select 0; _v = _this select 0;
if (!DZE_NoVehicleExplosions) then { if (!DZE_NoVehicleExplosions) then {
if (_v iskindof "helicopter" || _v iskindof "plane") then { if (_v iskindof "helicopter" || _v iskindof "plane") then {
["AirDestruction", _v] call BIS_Effects_globalEvent; ["AirDestruction", _v] call BIS_Effects_globalEvent;
}; };
if (_v iskindof "tank") then { if (_v iskindof "tank") then {
_int = (fuel _v)*(2+random 2); _int = (fuel _v)*(2+random 2);
_t = time;
[_v,_int] spawn BIS_Effects_Secondaries; [_v,_int] spawn BIS_Effects_Secondaries;
["Eject", _v] call BIS_Effects_globalEvent; ["Eject", _v] call BIS_Effects_globalEvent;
}; };
if (_v iskindof "car" || _v iskindof "ship") then { if (_v iskindof "car" || _v iskindof "ship") then {
_int = (fuel _v)*(2 + random 1); _int = (fuel _v)*(2 + random 1);
_t = time;
[_v,_int] spawn BIS_Effects_Secondaries; [_v,_int] spawn BIS_Effects_Secondaries;
["Eject", _v] call BIS_Effects_globalEvent; ["Eject", _v] call BIS_Effects_globalEvent;
if ((random _int)>2.2) then if ((random _int)>2.2) then