Skip to content

Commit

Permalink
fixed remaining issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AdlerSalbei committed Aug 17, 2019
1 parent 5dd95e8 commit 55fa2af
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 31 deletions.
8 changes: 7 additions & 1 deletion addons/trenches/CfgWorldTexture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ class CfgWorldTexture: CfgWorlds {
camouflageObjects[] = {"ca\plants_E\Clutter\c_Brush_Hard_EP1.p3d"};
};

//Livonia
class Enoch {
surfaceTextureBasePath = "A3\Map_Enoch\Data\";
suffix = "_co.paa";
};
//G.O.S Al Rayak
class pja310 {
surfaceTextureBasePath = "mak\projetA3-10\Data";
Expand Down Expand Up @@ -371,7 +377,7 @@ class CfgWorldTexture: CfgWorlds {
//Isla Duala
class isladuala3 {
surfaceTextureBasePath = "ibr\isladuala3\data";
suffix = "detail_co.paa";
suffix = "_co.paa";
camouflageObjects[] = {};
};
Expand Down
2 changes: 0 additions & 2 deletions addons/trenches/functions/fnc_addDigger.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ private _fnc_onFailure = {
private _fnc_condition = {
(_this select 0) params ["", "_trench", "_handle"];

diag_log str (_this select 0);

if (isNil "_handle") exitWith {false};
if (count (_trench getVariable [QGVAR(diggingPlayers),[]]) <= 1) exitWith {false};
if (GVAR(stopBuildingAtFatigueMax) && {QEGVAR(advanced_fatigue,anReserve) <= 0}) exitWith {false};
Expand Down
24 changes: 1 addition & 23 deletions addons/trenches/functions/fnc_continueDiggingTrench.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,45 +48,24 @@ if (isNil "_vecDirAndUp") then {

// Create progress bar
private _fnc_onFinish = {
systemChat str (_this select 0);
diag_log str (_this select 0);
(_this select 0) params ["_unit", "_trench"];
_trench setVariable [QGVAR(digging), false, true];
_trench setVariable [QGVAR(diggingType), nil, true];
_trench setVariable [QGVAR(diggingPlayers), [], true];
[QGVAR(handleDiggingServer), [_trench, _unit, false, true]] call CBA_fnc_serverEvent;
systemChat "Finish.";

// Save progress global
_trench setVariable [QGVAR(progress), 1, true];

// Reset animation
[_unit, "", 1] call EFUNC(common,doAnimation);

systemChat format [
"dig: %1, Typ: %2, Players: %3, progress: %4",
_trench getVariable [QGVAR(digging), false, true],
_trench getVariable [QGVAR(diggingType), nil, true],
_trench getVariable [QGVAR(diggingPlayers), [], true],
_trench getVariable [QGVAR(progress), 1, true]
];

diag_log format [
"dig: %1, Typ: %2, Players: %3, progress: %4",
_trench getVariable [QGVAR(digging), false, true],
_trench getVariable [QGVAR(diggingType), nil, true],
_trench getVariable [QGVAR(diggingPlayers), [], true],
_trench getVariable [QGVAR(progress), 1, true]
];


};

private _fnc_onFailure = {
(_this select 0) params ["_unit", "_trench"];
_trench setVariable [QGVAR(digging), false, true];
_trench setVariable [QGVAR(diggingType), nil, true];
_trench setVariable [QGVAR(diggingPlayers), _trench getVariable [QGVAR(diggingPlayers),[]] - [_unit], true];
systemChat "Failure";

// Save progress global
private _progress = _trench getVariable [QGVAR(progress), 0];
Expand Down Expand Up @@ -134,7 +113,6 @@ if (_actualProgress == 0) then {
};

if (_actualProgress >= 1) exitWith {
systemChat "PFH";
[_handle] call CBA_fnc_removePerFrameHandler;
};

Expand Down
2 changes: 1 addition & 1 deletion addons/trenches/functions/fnc_getSurfaceTexturePath.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private _result = if !(isNil QGVAR(automaticFileSetup)) then {
[_surfaceType, _basePath, _suffix] call _getTexturePath;
} else {
private _basePath = getText (configFile >> "CfgWorldTexture" >> "Altis" >> "surfaceTextureBasePath");
if ((_surfaceType find "#Gdt" == -1) || {worldName == "Tanoa"}) then {
if ((_surfaceType find "#Gdt" == -1) || {worldName == "Tanoa"} || {worldName == "Enoch"}) then {
_basePath = getText (configFile >> "CfgWorldTexture" >> worldName >> "surfaceTextureBasePath")
};

Expand Down
5 changes: 2 additions & 3 deletions addons/trenches/functions/fnc_placeTrench.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ GVAR(digPFH) = [{
// Update trench position
GVAR(trenchPlacementData) params ["_dx", "_dy", "_offset"];
private _basePos = _unit modelToWorld [0,2,0];

private _angle = GVAR(digDirection) + getDir _unit;

// _v1 forward from the player, _v2 to the right, _v3 points away from the ground
Expand All @@ -84,8 +83,8 @@ GVAR(digPFH) = [{
#endif
};
};
// _basePos set [2, (_basePos select 2) + _minzoffset + _offset - 0.1];
_basePos set [2, (_basePos select 2) + _minzoffset - 0.1];

_basePos set [2, (_basePos select 2) + _minzoffset + _offset - 0.1];
TRACE_2("",_minzoffset,_offset);
_trench setPosASL _basePos;
_trench setVectorDirAndUp [_v1, _v3];
Expand Down
1 change: 0 additions & 1 deletion addons/trenches/functions/fnc_removeTrench.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* Public: No
*/

systemChat str _this;
params ["_trench", "_unit", ["_switchingDigger", false, [true]]];
TRACE_2("removeTrench", _trench, _unit, _switchingDigger);

Expand Down

0 comments on commit 55fa2af

Please sign in to comment.