Fix relog over base in air vehicle to get inside exploit

Tested over forest, regular terrain and water without issue.
This commit is contained in:
ebaydayz
2016-08-28 11:35:32 -04:00
parent 0f043313ab
commit 7b354e7d55
2 changed files with 20 additions and 3 deletions

View File

@@ -106,6 +106,7 @@
[FIXED] Study body message saying his/he on female players. @ebaydayz [FIXED] Study body message saying his/he on female players. @ebaydayz
[FIXED] Destroyed objects (i.e. ore veins, ammo crates and wrecked buildables) are now deleted globally after being removed. #1730 @icomrade [FIXED] Destroyed objects (i.e. ore veins, ammo crates and wrecked buildables) are now deleted globally after being removed. #1730 @icomrade
[FIXED] UH1Y and AH6X unkown animation source RPT errors, and added back observer seats to AH6X and UH1Y without thermal imaging. @icomrade [FIXED] UH1Y and AH6X unkown animation source RPT errors, and added back observer seats to AH6X and UH1Y without thermal imaging. @icomrade
[FIXED] Players can no longer relog over bases in a helicopter, parachute or plane to get inside. @ebaydayz
[UPDATED] .hpp files updated in dayz_code\Configs\CfgLoot\CfgBuildingPos. @Uro1 [UPDATED] .hpp files updated in dayz_code\Configs\CfgLoot\CfgBuildingPos. @Uro1
[UPDATED] .bat files updated in Config-Examples @Raziel23x [UPDATED] .bat files updated in Config-Examples @Raziel23x

View File

@@ -1,4 +1,4 @@
private ["_playerObj","_myGroup","_playerUID","_playerPos","_playerName","_message"]; private ["_playerObj","_myGroup","_playerUID","_playerPos","_playerName","_message","_newPos","_failSpot","_count","_maxDist","_relocate"];
_playerUID = _this select 0; _playerUID = _this select 0;
_playerName = _this select 1; _playerName = _this select 1;
@@ -59,7 +59,24 @@ if (_characterID != "?") exitwith {
//if the player object is inside a vehicle lets eject the player //if the player object is inside a vehicle lets eject the player
if (vehicle _playerObj != _playerObj) then { if (vehicle _playerObj != _playerObj) then {
_relocate = if (vehicle _playerObj isKindOf "Air") then {true} else {false};
_playerObj action ["eject", vehicle _playerObj]; _playerObj action ["eject", vehicle _playerObj];
// Prevent relog in parachute, heli or plane above base exploit to get inside
if (_relocate) then {
_count = 0;
_maxDist = 120;
_newPos = [_playerPos, 80, _maxDist, 10, 1, 0, 0] call BIS_fnc_findSafePos;
_failSpot = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
while {_newPos distance _failSpot == 0} do {
_count = _count + 1;
if (_count > 40) exitWith {_newPos = _playerPos;}; // Max 4km away fail safe
_newPos = [_playerPos, 80, (_maxDist + 100), 10, 1, 0, 0] call BIS_fnc_findSafePos;
};
_playerObj setPos _newPos;
diag_log format["Relocated %1(%2) %3m from logout postion for logout in air vehicle",_playerName,_playerUID,_playerPos distance _newPos];
};
}; };
//Punish combat log //Punish combat log
@@ -99,5 +116,4 @@ if (isNull _playerObj) then { diag_log("Player Object does not esist"); };
if (!isNull _playerObj) then { if (!isNull _playerObj) then {
_myGroup = group _playerObj; _myGroup = group _playerObj;
deleteGroup _myGroup; deleteGroup _myGroup;
}; };