Skip to content

Commit 480bf7a

Browse files
authored
Merge pull request #64 from Bob-Murphy/unstable
Merge unstable to master creating version 1.4c1.04
2 parents eb49914 + 2a51408 commit 480bf7a

File tree

20 files changed

+125
-62
lines changed

20 files changed

+125
-62
lines changed

A3-Antistasi/AI/AAFKilledEH.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if (side (group _killer) == teamPlayer) then
5050
if ((player distance _victim < 300) and (captive player)) then {player setCaptive false};
5151
};
5252
};
53-
if (count weapons _victim < 1) then
53+
if (count weapons _victim < 1 && !(_victim getVariable ["isAnimal", false])) then
5454
{
5555
if (_sideX == Occupants) then
5656
{

A3-Antistasi/AI/guardDog.sqf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ _dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
77
_dog disableAI "FSM";
88
_dog setBehaviour "CARELESS";
99
_dog setRank "PRIVATE";
10+
_dog setVariable ["isAnimal", true, true];
1011

1112
while {alive _dog} do
1213
{

A3-Antistasi/CREATE/CIVinit.sqf

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ _unit disableAI "AUTOTARGET";
1111

1212
_unit addEventHandler ["HandleDamage",
1313
{
14+
private _unit = _this select 0;
1415
_dam = _this select 2;
1516
_proy = _this select 4;
17+
_injurer = _this select 3;
18+
if(!isNil "_injurer" && isPlayer _injurer) then {
19+
_unit setVariable ["injuredByPlayer", _injurer, true];
20+
_unit setVariable ["lastInjuredByPlayer", time, true];
21+
};
1622
if (_proy == "") then
1723
{
18-
_injurer = _this select 3;
19-
if ((_dam > 0.95) and (!isPlayer _injurer)) then {_dam = 0.9};
24+
if ((_dam > 0.95) and (!isPlayer _injurer)) then {_dam = 0.9};
2025
};
2126
_dam
2227
}
@@ -25,6 +30,12 @@ _EHkilledIdx = _unit addEventHandler ["killed",
2530
{
2631
_victim = _this select 0;
2732
_killer = _this select 1;
33+
if (time - (_victim getVariable ["lastInjuredByPlayer", 0]) < 120) then {
34+
_killer = _victim getVariable ["injuredByPlayer", _killer];
35+
};
36+
if (isNull _killer) then {
37+
_killer = _victim;
38+
};
2839
if (_victim == _killer) then
2940
{
3041
_nul = [-1,-1,getPos _victim] remoteExec ["A3A_fnc_citySupportChange",2];

A3-Antistasi/Debugging/spawnDebuggingLoop.sqf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ while {shouldRunDebuggingLoop} do {
1212
diag_log "[Antistasi] Cleaning groups";
1313
[teamPlayer] remoteExec ["A3A_fnc_deleteEmptyGroupsOnSide", 0];
1414
[civilian] remoteExec ["A3A_fnc_deleteEmptyGroupsOnSide", 0];
15+
[Occupants] remoteExec ["A3A_fnc_deleteEmptyGroupsOnSide", 0];
16+
[Invaders] remoteExec ["A3A_fnc_deleteEmptyGroupsOnSide", 0];
1517
_lastGroupCleanTime = serverTime;
1618
};
1719

A3-Antistasi/JeroenArsenal/JNA/fn_arsenal_loadInventory.sqf

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,12 @@ _backpackItems = _inventory select 2 select 1;
312312

313313
//add containers
314314
_containers = [_uniform,_vest,_backpack];
315-
private _invCallArray = [{removeUniform player;player forceAddUniform _uniform;},//todo remove
316-
{removeVest player;player addVest _vest;},
317-
{removeBackpackGlobal player;player addBackpack _backpack;}];
315+
private _removeContainerFuncs = [{removeUniform player;},{removeVest player;},{removeBackpackGlobal player;}];
316+
private _addContainerFuncs = [
317+
{player forceAddUniform (_this select 0);},
318+
{player addVest (_this select 0);},
319+
{player addBackpack (_this select 0);}
320+
];
318321
{
319322
_item = _x;
320323
if!(_item isEqualTo "")then{
@@ -324,20 +327,22 @@ private _invCallArray = [{removeUniform player;player forceAddUniform _uniform;}
324327
IDC_RSCDISPLAYARSENAL_TAB_VEST,
325328
IDC_RSCDISPLAYARSENAL_TAB_BACKPACK
326329
] select _foreachindex;
327-
330+
331+
_addContainerFunc = (_addContainerFuncs select _foreachindex);
332+
328333
call {
329334
if ([_itemCounts select _index, _item] call jn_fnc_arsenal_itemCount == -1) exitWith {
330-
call (_invCallArray select _foreachindex);
335+
[_item] call _addContainerFunc;
331336
};
332337

333338
if ([_availableItems select _index, _item] call jn_fnc_arsenal_itemCount > 0) then {
334-
call (_invCallArray select _foreachindex);
339+
[_item] call _addContainerFunc;
335340
[_arrayTaken,_index,_item,_amount] call _addToArray;
336341
[_availableItems,_index,_item,_amount] call _removeFromArray;
337342
} else {
338343
_oldItem = [_uniform_old,_vest_old,_backpack_old] select _foreachindex;
339344
if !(_oldItem isEqualTo "") then {
340-
call (_invCallArray select _foreachindex);
345+
[_oldItem] call _addContainerFunc;
341346
_arrayReplaced = [_arrayReplaced,[_item,_oldItem]] call jn_fnc_arsenal_addToArray;
342347
[_arrayTaken,_index,_oldItem,1] call _addToArray;
343348
} else {
@@ -407,11 +412,23 @@ private _invCallArray = [{removeUniform player;player forceAddUniform _uniform;}
407412
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Update global
408413
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
409414

415+
private _lookupConfigName = {
416+
private _class = param [0];
417+
private _configs = "configName _x == _class" configClasses (configFile >> "CfgWeapons");
418+
if (count _configs > 0) exitWith {
419+
[_configs select 0] call BIS_fnc_displayName;
420+
};
421+
private _configs = "configName _x == _class" configClasses (configFile >> "CfgMagazines");
422+
if (count _configs > 0) exitWith {
423+
[_configs select 0] call BIS_fnc_displayName;
424+
};
425+
_class;
426+
};
427+
410428
_arrayAdd = [_arrayPlaced, _arrayTaken] call _subtractArrays; //remove items that where not added
411429
_arrayRemove = [_arrayTaken, _arrayPlaced] call _subtractArrays;
412430

413431
_arrayAdd call jn_fnc_arsenal_addItem;
414-
diag_log "adadadadada";
415432
diag_log _arrayTaken;
416433
diag_log _arrayPlaced;
417434
_arrayRemove call jn_fnc_arsenal_removeItem;
@@ -422,24 +439,24 @@ _arrayRemove call jn_fnc_arsenal_removeItem;
422439
_reportTotal = "";
423440
_reportReplaced = "";
424441
{
425-
_nameNew = _x select 0;
426-
_nameOld = _x select 1;
427-
_reportReplaced = _reportReplaced + _nameOld + " instead of " + _nameNew + "\n";
442+
_nameNew = [_x select 0] call _lookupConfigName;
443+
_nameOld = [_x select 1] call _lookupConfigName;
444+
_reportReplaced = _reportReplaced + _nameOld + " has been kept, because there is no " + _nameNew + "\n";
428445
} forEach _arrayReplaced;
429446

430447
if!(_reportReplaced isEqualTo "")then{
431-
_reportTotal = ("I keep this items because i couldn't find the other ones:\n" + _reportReplaced+"\n");
448+
_reportTotal = ("These items were not in the Arsenal, so the originals have been kept:\n" + _reportReplaced+"\n");
432449
};
433450

434451
_reportMissing = "";
435452
{
436-
_name = _x select 0;
453+
_name = [_x select 0] call _lookupConfigName;
437454
_amount = _x select 1;
438455
_reportMissing = _reportMissing + _name + " (" + (str _amount) + "x)\n";
439456
}forEach _arrayMissing;
440457

441458
if!(_reportMissing isEqualTo "")then{
442-
_reportTotal = (_reportTotal+"I couldn't find the following items:\n" + _reportMissing+"\n");
459+
_reportTotal = (_reportTotal+"These items were not in the Arsenal:\n" + _reportMissing+"\n");
443460
};
444461

445462
if!(_reportTotal isEqualTo "")then{

A3-Antistasi/Templates/A3-AA-BLUFORTemplate.Altis/mission.sqm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class Mission
153153
{
154154
class Intel
155155
{
156-
briefingName="A3-Antistasi Altis BLUEFOR 1.4c1.03";
156+
briefingName="A3-Antistasi Altis BLUEFOR 1.4c1.04";
157157
overviewText="Build FIA Army from scratch and defeat the AAF and CSAT forces in a whole map Dynamic Mission.";
158158
resistanceWest=0;
159159
startWeather=0;

A3-Antistasi/Templates/A3-AATemplate.Altis/mission.sqm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class Mission
161161
{
162162
class Intel
163163
{
164-
briefingName="A3-Antistasi Altis 1.4c1.03";
164+
briefingName="A3-Antistasi Altis 1.4c1.04";
165165
overviewText="Build FIA Army from scratch and defeat the AAF and CSAT forces in a whole map Dynamic Mission.";
166166
resistanceWest=0;
167167
startWeather=0;

A3-Antistasi/Templates/A3-ArmiaKrajowaTemplate.chernarus_summer/mission.sqm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class Mission
179179
{
180180
class Intel
181181
{
182-
briefingName="A3-Antistasi Armia Krajowa Chernarus 1.4c1.03";
182+
briefingName="A3-Antistasi Armia Krajowa Chernarus 1.4c1.04";
183183
resistanceWest=0;
184184
timeOfChanges=1800.0002;
185185
startWeather=0.25;

A3-Antistasi/Templates/A3-WotPTemplate.Tanoa/mission.sqm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ class Mission
425425
{
426426
class Intel
427427
{
428-
briefingName="Antistasi - Warlords of the Pacific - 1.4c1.03";
428+
briefingName="Antistasi - Warlords of the Pacific - 1.4c1.04";
429429
overviewText="Build a Syndikat Army from scratch and defeat NATO and CSAT forces in a persistent mission with Tanoa as AO.";
430430
resistanceWest=0;
431431
timeOfChanges=1800.0002;

A3-Antistasi/buildHQ.sqf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ if (petros != (leader group petros)) then
88
[petros] join groupPetros;
99
};
1010
[petros,"remove"] remoteExec ["A3A_fnc_flagaction",0,petros];
11+
petros switchAction "PlayerStand";
1112
petros disableAI "MOVE";
1213
petros disableAI "AUTOTARGET";
1314
respawnTeamPlayer setMarkerPos getPos petros;

0 commit comments

Comments
 (0)