#15 Upgrade to Epoch 1.7.0.1 (#16)

Closes #15

Reviewed-on: #16
Co-authored-by: stuzer05 <stuzer05@stuzer.link>
Co-committed-by: stuzer05 <stuzer05@stuzer.link>
This commit is contained in:
2023-10-01 21:22:36 +03:00
committed by スツゼル
parent 802e6b3552
commit 61de8f76f3
58 changed files with 2295 additions and 524 deletions

View File

@ -18,37 +18,4 @@ VG_RandomizeMyKey = {
_return;
};
vg_serverKey = toString (8 call VG_RandomizeMyKey);
vg_alreadySpawned = [];
VG_ClearTurrets = {
//By denvdmj (probably, I found it on the biki)
private ["_weaponArray","_findRecurse","_class","_obj","_turret","_mags"];
_obj = _this;
_weaponArray = [];
_weaponArray set [count _weaponArray,[-1]];
_findRecurse = {
private ["_root", "_class", "_path", "_currentPath", "_thisThis"];
_root = (_this select 0);
_path = +(_this select 1);
_thisThis = _this select 2;
for "_i" from 0 to count _root -1 do {
_class = _root select _i;
if (isClass _class) then {
_currentPath = _path + [_i];
{_weaponArray set [count _weaponArray, _currentPath];} count getArray (_class >> "weapons");
_class = _class >> "turrets";
if (isClass _class) then {[_class, _currentPath, _thisThis] call _findRecurse;};
};
};
};
[configFile >> "CfgVehicles" >> typeOf (_obj) >> "turrets", [], _this] call _findRecurse;
{
_turret = _x;
_mags = _obj magazinesTurret _turret;
{_obj removeMagazinesTurret[_x,_turret];} count _mags;
} forEach _weaponArray;
};
vg_alreadySpawned = [];

View File

@ -1,4 +1,4 @@
private ["_isAir","_VG_ObjID","_characterID","_class","_clientID","_clrinit","_clrinit2","_colour","_colour2","_dam","_damage","_dir","_fuel","_hitpoints","_id","_inventory","_key","_location","_message","_object","_oid","_outcome","_player","_result","_selection","_serverKey","_uid","_worldSpace"];
private ["_VG_ObjID","_characterID","_class","_clientID","_clrinit","_clrinit2","_colour","_colour2","_dam","_damage","_dir","_fuel","_hitpoints","_id","_inventory","_key","_location","_message","_object","_oid","_outcome","_player","_result","_selection","_serverKey","_uid","_worldSpace"];
_worldSpace = _this select 0;
_player = _this select 1;
@ -53,18 +53,17 @@ if (_outcome != "PASS") then {
_object setPos _location;
};
_object addEventHandler ["HandleDamage",{false}];
_object addEventHandler ["HandleDamage",{0}];
clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object;
if (vg_clearAmmo && {vg_serverKey == _serverKey}) then {_object call VG_ClearTurrets;};
_object setFuel _fuel;
_object setDamage _damage;
[_inventory select 0,_inventory select 1,_inventory select 2,_object] call fn_addCargo;
_object setVariable ["ObjectID", _oid, true];
_object setVariable ["ObjectID", _oid];
_object setVariable ["lastUpdate",diag_tickTime];
_object setVariable ["VGObjectID",_VG_ObjID, false];
@ -83,22 +82,19 @@ if (_outcome != "PASS") then {
processInitCommands;
_characterID = str(_characterID);
_object setVariable ["CharacterID", _characterID, true];
_object setVariable ["CharacterID", _characterID, [true,false] select (_characterID == "0")];
if (_characterID != "0" && !(_object isKindOf "Bicycle")) then {_object setVehicleLock "LOCKED";};
_isAir = _object isKindOf "Air";
{
_selection = _x select 0;
_dam = _x select 1;
_dam = [_x select 1,(_x select 1) min 0.8] select (!_isAir && {_selection in dayZ_explosiveParts});
[_object,_selection,_dam] call fnc_veh_setFixServer;
} forEach _hitpoints;
[_object,_hitpoints] call server_setHitpoints;
[_object,"all",true] call server_updateObject;
[_object,vg_clearAmmo,false] call fn_vehicleAddons;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
_object call fnc_veh_ResetEH;
{if (_object isKindOf _x) exitWith {_object disableTIEquipment true;}} count vg_disableThermal;
_object call fnc_veh_ResetEH;
PVDZE_veh_Init = _object;
publicVariable "PVDZE_veh_Init";

View File

@ -1,4 +1,4 @@
private ["_damageVeh","_VGobjID","_array","_backPack","_backPackCount","_charID","_class","_clientID","_colour","_colour2","_damage","_displayName","_fnc_sanitizeInput","_fuel","_gearCount","_hit","_hitpoints","_index","_inventory","_inventoryCount","_key","_magazine","_magazineCount","_message","_name","_objectID","_objectUID","_player","_playerUID","_selection","_vehicle","_weapons","_weaponsCount","_woGear"];
private ["_damageVeh","_VGobjID","_array","_backPack","_backPackCount","_charID","_class","_clientID","_colour","_colour2","_damage","_displayName","_fuel","_hit","_hitpoints","_index","_inventory","_inventoryCount","_key","_magazine","_magazineCount","_message","_name","_objectID","_objectUID","_player","_playerUID","_selection","_vehicle","_weapons","_weaponsCount","_woGear"];
_vehicle = _this select 0;
_player = _this select 1;
@ -6,31 +6,9 @@ _woGear = _this select 2;
_clientID = owner _player;
_playerUID = if (count _this > 3) then {_this select 3} else {getPlayerUID _player};
_gearCount = {
private ["_counter"];
_counter = 0;
{_counter = _counter + _x;} count _this;
_counter;
};
_fnc_sanitizeInput = {
private ["_input","_badChars"];
_input = _this;
_input = toArray (_input);
_badChars = [60,62,38,123,125,91,93,59,58,39,96,126,44,46,47,63,124,92,34];
{
_input = _input - [_x];
} forEach _badChars;
_input = toString (_input);
_input
};
_class = typeOf _vehicle;
_displayName = (getText(configFile >> "cfgVehicles" >> _class >> "displayName")) call _fnc_sanitizeInput;
_name = if (alive _player) then {(name _player) call _fnc_sanitizeInput;} else {"unknown player";};
_displayName = [(getText(configFile >> "cfgVehicles" >> _class >> "displayName")),1] call fnc_sanitizeInput;
_name = if (alive _player) then {[(name _player),1] call fnc_sanitizeInput;} else {"unknown player";};
_charID = _vehicle getVariable ["CharacterID","0"];
_objectID = _vehicle getVariable ["ObjectID","0"];
@ -71,9 +49,9 @@ if (!_woGear) then {
_weapons = getWeaponCargo _vehicle;
_magazine = getMagazineCargo _vehicle;
_backPack = getBackpackCargo _vehicle;
_weaponsCount = (_weapons select 1) call _gearCount;
_magazineCount = (_magazine select 1) call _gearCount;
_backPackCount = (_backPack select 1) call _gearCount;
_weaponsCount = (_weapons select 1) call fnc_gearCount;
_magazineCount = (_magazine select 1) call fnc_gearCount;
_backPackCount = (_backPack select 1) call fnc_gearCount;
_inventory = [_weapons, _magazine, _backPack];
_inventoryCount = [_weaponsCount, _magazineCount, _backPackCount];
};