Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
veteran29 committed Mar 14, 2024
1 parent 1a9dcca commit 0ad5bcb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ if (isNull _grp) exitwith {
["Attempted to set LAMBS Reinforcements on null group.", "ERROR"] remoteExecCall ["KPLIB_fnc_log", 2];
};

(leader _grp) setVariable ["lambs_danger_dangerRadio", true,true];
(leader _grp) setVariable ["lambs_danger_dangerRadio", true, true];
_grp setVariable ["lambs_danger_enableGroupReinforce", true, true];
11 changes: 4 additions & 7 deletions Missionframework/functions/fn_spawnVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,12 @@ if (_classname in KPLIB_o_militiaVehicles) then {
private _crew = units (createVehicleCrew _newvehicle);
_crew joinSilent _grp;
{
_x addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];

["KPLIB_manageKills", [_unit,_killer]] call CBA_fnc_serverEvent;
}];

_x addMPEventHandler ["MPKilled", {
params ["_unit", "_killer"];
["KPLIB_manageKills", [_unit, _killer]] call CBA_fnc_localEvent;
}];
} forEach _crew;
};
};

// Add Killed and GetIn EHs and enable damage again
_newvehicle addMPEventHandler ["MPKilled", {
Expand Down
2 changes: 0 additions & 2 deletions Missionframework/scripts/server/ai/battlegroup_ai.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ private _waypoint = [];
{ deleteWaypoint _x } forEachReversed waypoints _grp;
{_x doFollow leader _grp} forEach units _grp;

_startpos = getPos (leader _grp);

_waypoint = _grp addWaypoint [_objPos, 100];
_waypoint setWaypointType "MOVE";
_waypoint setWaypointSpeed "NORMAL";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ if !(_spawn_marker isEqualTo "") then {

for "_i" from 1 to _squadNumber do {
// Create infantry groups with up to 8 units per squad
private _grp = createGroup [kplib_side_enemy, true];
private _grp = createGroup [KPLIB_side_enemy, true];
for "_i" from 0 to 7 do {
[selectRandom _infClasses, markerPos _spawn_marker, _grp] call KPLIB_fnc_createManagedUnit;
};
[_grp] call KPLIB_fnc_LAMBS_enableReinforcements;
[_grp] call battlegroup_ai;
_grp setVariable ["KPLIB_isBattleGroup",true];
[_grp] call KPLIB_fnc_LAMBS_enableReinforcements;
[_grp] call battlegroup_ai;
_grp setVariable ["KPLIB_isBattleGroup",true];
};
} else {
private _vehicle_pool = [KPLIB_o_battleGrpVehicles, KPLIB_o_battleGrpVehiclesLight] select (KPLIB_enemyReadiness < 50);
Expand All @@ -56,7 +56,7 @@ if !(_spawn_marker isEqualTo "") then {

(crew _vehicle) joinSilent _nextgrp;
[_nextgrp] call battlegroup_ai;
_nextgrp setVariable ["KPLIB_isBattleGroup",true];
_nextgrp setVariable ["KPLIB_isBattleGroup", true];

if ((_x in KPLIB_o_troopTransports) && ([] call KPLIB_fnc_getOpforCap < KPLIB_cap_battlegroup)) then {
if (_vehicle isKindOf "Air") then {
Expand Down
2 changes: 1 addition & 1 deletion Missionframework/scripts/server/init_server.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ if (KPLIB_param_restart > 0) then {

["KPLIB_ResetBattleGroups", {
{
if (_x getVariable ["KPLIB_isBattleGroup",false]) then {
if (_x getVariable ["KPLIB_isBattleGroup", false]) then {
[_x] call battlegroup_ai;
}
} foreach allGroups;
Expand Down

0 comments on commit 0ad5bcb

Please sign in to comment.