DynSim Toggle #2 Vehicles

This commit is contained in:
DESKTOP-UH65DCE\MusTanG 2017-04-24 21:21:29 -05:00
parent 89036defd1
commit f105490cca
6 changed files with 51 additions and 11 deletions

View File

@ -20,7 +20,10 @@
{ {
{ {
_x enableSimulationGlobal true; _x enableSimulationGlobal true;
(vehicle _x) enableSimulationGlobal true; if!(dynamicSimulationEnabled (vehicle _x))then
{
(vehicle _x) enableSimulationGlobal true;
};
} forEach _units; } forEach _units;
_x setVariable ["DMS_isGroupFrozen",false]; _x setVariable ["DMS_isGroupFrozen",false];
@ -81,7 +84,10 @@
{ {
{ {
_x enableSimulationGlobal false; _x enableSimulationGlobal false;
(vehicle _x) enableSimulationGlobal false; if!(dynamicSimulationEnabled (vehicle _x))then
{
(vehicle _x) enableSimulationGlobal false;
};
} forEach _units; } forEach _units;
_x setVariable ["DMS_isGroupFrozen",true]; _x setVariable ["DMS_isGroupFrozen",true];

View File

@ -24,7 +24,10 @@ if (_freeze) then
{ {
{ {
_x enableSimulationGlobal false; _x enableSimulationGlobal false;
(vehicle _x) enableSimulationGlobal false; if!(dynamicSimulationEnabled (vehicle _x))then
{
(vehicle _x) enableSimulationGlobal false;
};
} forEach (units _group); } forEach (units _group);
_group setVariable ["DMS_isGroupFrozen",true]; _group setVariable ["DMS_isGroupFrozen",true];
@ -33,7 +36,10 @@ else
{ {
{ {
_x enableSimulationGlobal true; _x enableSimulationGlobal true;
(vehicle _x) enableSimulationGlobal true; if!(dynamicSimulationEnabled (vehicle _x))then
{
(vehicle _x) enableSimulationGlobal true;
};
} forEach (units _group); } forEach (units _group);
_group setVariable ["DMS_isGroupFrozen",false]; _group setVariable ["DMS_isGroupFrozen",false];

View File

@ -142,7 +142,10 @@
{ {
_x allowDamage true; _x allowDamage true;
_x enableRopeAttach true; _x enableRopeAttach true;
_x enableSimulationGlobal true; if!(dynamicSimulationEnabled _x)then
{
_x enableSimulationGlobal true;
};
if (_x getVariable ["ExileIsPersistent", false]) then if (_x getVariable ["ExileIsPersistent", false]) then
{ {
@ -162,7 +165,7 @@
_x lock 1; _x lock 1;
}; };
_x call ExileServer_system_simulationMonitor_addVehicle; //_x call ExileServer_system_simulationMonitor_addVehicle;
} forEach _vehs; } forEach _vehs;
{ {

View File

@ -143,7 +143,10 @@
{ {
_x allowDamage true; _x allowDamage true;
_x enableRopeAttach true; _x enableRopeAttach true;
_x enableSimulationGlobal true; if!(dynamicSimulationEnabled _x)then
{
_x enableSimulationGlobal true;
};
if (_x getVariable ["ExileIsPersistent", false]) then if (_x getVariable ["ExileIsPersistent", false]) then
{ {
@ -163,7 +166,7 @@
_x lock 1; _x lock 1;
}; };
_x call ExileServer_system_simulationMonitor_addVehicle; //_x call ExileServer_system_simulationMonitor_addVehicle;
} forEach _vehs; } forEach _vehs;
{ {

View File

@ -105,7 +105,14 @@ if (!(_grpUnits isEqualTo []) && {(leader _grp) isEqualTo _unit}) then
private _av = _unit getVariable ["DMS_AssignedVeh",objNull]; private _av = _unit getVariable ["DMS_AssignedVeh",objNull];
if (!isNull _av) then if (!isNull _av) then
{ {
_av enableSimulationGlobal true; if(dynamicSimulationSystemEnabled)then
{
_av enableDynamicSimulation true;
}
else
{
_av enableSimulationGlobal true;
};
// Determine whether or not the vehicle has any active crew remaining. // Determine whether or not the vehicle has any active crew remaining.
private _memCount = {[(alive _x),false] select (_unit isEqualTo _x);} count (crew _av); private _memCount = {[(alive _x),false] select (_unit isEqualTo _x);} count (crew _av);
@ -149,8 +156,16 @@ if (!isNull _av) then
[_av, 1] remoteExecCall ["lock", _av]; [_av, 1] remoteExecCall ["lock", _av];
}; };
_av call ExileServer_system_simulationMonitor_addVehicle; //_av call ExileServer_system_simulationMonitor_addVehicle;
if(dynamicSimulationSystemEnabled)then
{
_av enableDynamicSimulation true;
}
else
{
_av enableSimulationGlobal true;
};
_av setVariable ["ExileMoney",0,true]; _av setVariable ["ExileMoney",0,true];
_av setVariable ["ExileIsPersistent", false]; _av setVariable ["ExileIsPersistent", false];
_av addMPEventHandler ["MPKilled", { if (isServer) then {_this call ExileServer_object_vehicle_event_onMPKilled;};}]; _av addMPEventHandler ["MPKilled", { if (isServer) then {_this call ExileServer_object_vehicle_event_onMPKilled;};}];

View File

@ -85,7 +85,14 @@ if (!isNil "AVS_Version") then
_vehObj lock 2; _vehObj lock 2;
_vehObj allowDamage false; _vehObj allowDamage false;
_vehObj enableRopeAttach false; _vehObj enableRopeAttach false;
_vehObj enableSimulationGlobal false; if(dynamicSimulationSystemEnabled)then
{
_vehObj enableDynamicSimulation true;
}
else
{
_vehObj enableSimulationGlobal false;
};
if (DMS_DEBUG) then if (DMS_DEBUG) then