Single infantry catch implemented

It could happen, that infantry classnames from the "build one soldier" tab aren't listed inside the predefined squads, which prevented that they'll be saved.
Also cleared the kill_manager.sqf a little bit.
This commit is contained in:
Christian 2017-07-13 18:46:10 +02:00
parent 3939e5331d
commit 974b8c3358
3 changed files with 37 additions and 33 deletions

View File

@ -42,6 +42,7 @@ opfor_squad_8_tankkillers = [opfor_squad_leader,opfor_medic,opfor_machinegunner,
opfor_squad_8_airkillers = [opfor_squad_leader,opfor_medic,opfor_machinegunner,opfor_rpg,opfor_rpg,opfor_aa,opfor_aa,opfor_aa];
friendly_infantry_classnames = [];
{if (!(_x in friendly_infantry_classnames)) then {friendly_infantry_classnames pushBack _x};} forEach (blufor_squad_inf_light + blufor_squad_inf + blufor_squad_at + blufor_squad_aa + blufor_squad_recon + blufor_squad_para);
{if (!((_x select 0) in friendly_infantry_classnames)) then {friendly_infantry_classnames pushBack (_x select 0)};} forEach infantry_units;
all_resistance_troops = [] + militia_squad;
all_hostile_classnames = (land_vehicles_classnames + opfor_air + opfor_choppers + opfor_troup_transports + opfor_vehicles_low_intensity);
{ land_vehicles_classnames pushback (_x select 0); } foreach (heavy_vehicles + light_vehicles);

View File

@ -1,83 +1,85 @@
params [ "_unit", "_killer" ];
private [ "_nearby_bigtown" ];
params ["_unit", "_killer"];
private ["_nearby_bigtown"];
if ( isServer ) then {
if (isServer) then {
if (KP_liberation_debug) then {private _text = format ["[KP LIBERATION] [DEBUG] Kill Manager started on: %1 - _unit: %2 - _killer: %3", debug_source, _unit, _killer];_text remoteExec ["diag_log",2];};
please_recalculate = true;
if ( isNil "infantry_weight" ) then { infantry_weight = 33 };
if ( isNil "armor_weight" ) then { armor_weight = 33 };
if ( isNil "air_weight" ) then { air_weight = 33 };
if (isNil "infantry_weight") then {infantry_weight = 33};
if (isNil "armor_weight") then {armor_weight = 33};
if (isNil "air_weight") then {air_weight = 33};
if ( side _killer == GRLIB_side_friendly ) then {
if ((side _killer) == GRLIB_side_friendly) then {
_nearby_bigtown = [ sectors_bigtown, { (!(_x in blufor_sectors)) && ( _unit distance (markerpos _x) < 250 ) } ] call BIS_fnc_conditionalSelect;
if ( count _nearby_bigtown > 0 ) then {
_nearby_bigtown = [sectors_bigtown, {!(_x in blufor_sectors) && (_unit distance (markerpos _x) < 250) } ] call BIS_fnc_conditionalSelect;
if (count _nearby_bigtown > 0) then {
combat_readiness = combat_readiness + (0.5 * GRLIB_difficulty_modifier);
stats_readiness_earned = stats_readiness_earned + (0.5 * GRLIB_difficulty_modifier);
if ( combat_readiness > 100.0 && GRLIB_difficulty_modifier < 2 ) then { combat_readiness = 100.0 };
if (combat_readiness > 100.0 && GRLIB_difficulty_modifier < 2) then {combat_readiness = 100.0};
};
if ( _killer isKindOf "Man" ) then {
if (_killer isKindOf "Man") then {
infantry_weight = infantry_weight + 1;
armor_weight = armor_weight - 0.66;
air_weight = air_weight - 0.66;
} else {
if ( (typeof (vehicle _killer) ) in land_vehicles_classnames ) then {
if ((typeof (vehicle _killer)) in land_vehicles_classnames) then {
infantry_weight = infantry_weight - 0.66;
armor_weight = armor_weight + 1;
air_weight = air_weight - 0.66;
};
if ( (typeof (vehicle _killer) ) in air_vehicles_classnames ) then {
if ((typeof (vehicle _killer)) in air_vehicles_classnames) then {
infantry_weight = infantry_weight - 0.66;
armor_weight = armor_weight - 0.66;
air_weight = air_weight + 1;
};
};
if ( infantry_weight > 100 ) then { infantry_weight = 100 };
if ( armor_weight > 100 ) then { armor_weight = 100 };
if ( air_weight > 100 ) then { air_weight = 100 };
if ( infantry_weight < 0 ) then { infantry_weight = 0 };
if ( armor_weight < 0 ) then { armor_weight = 0 };
if ( air_weight < 0 ) then { air_weight = 0 };
if (infantry_weight > 100) then {infantry_weight = 100};
if (armor_weight > 100) then {armor_weight = 100};
if (air_weight > 100) then {air_weight = 100};
if (infantry_weight < 0) then {infantry_weight = 0};
if (armor_weight < 0) then {armor_weight = 0};
if (air_weight < 0) then {air_weight = 0};
};
if ( isPlayer _unit ) then {
if (isPlayer _unit) then {
stats_player_deaths = stats_player_deaths + 1;
// Disconnect UAV from player on death
_unit connectTerminalToUAV objNull;
if (vehicle _unit != _unit) then {moveOut _unit;};
};
if ( _unit isKindOf "Man" ) then {
if ( side (group _unit) == GRLIB_side_civilian ) then {
if (_unit isKindOf "Man") then {
if (side (group _unit) == GRLIB_side_civilian) then {
stats_civilians_killed = stats_civilians_killed + 1;
if ( isPlayer _killer ) then {
if (isPlayer _killer) then {
stats_civilians_killed_by_players = stats_civilians_killed_by_players + 1;
};
};
if ( side _killer == GRLIB_side_friendly ) then {
if ( side (group _unit) == GRLIB_side_enemy ) then {
if (side _killer == GRLIB_side_friendly) then {
if (side (group _unit) == GRLIB_side_enemy) then {
stats_opfor_soldiers_killed = stats_opfor_soldiers_killed + 1;
if ( isplayer _killer ) then {
if (isplayer _killer) then {
stats_opfor_killed_by_players = stats_opfor_killed_by_players + 1;
};
};
if ( side (group _unit) == GRLIB_side_friendly ) then {
if (side (group _unit) == GRLIB_side_friendly) then {
stats_blufor_teamkills = stats_blufor_teamkills + 1;
};
} else {
if ( side (group _unit) == GRLIB_side_friendly ) then {
if (side (group _unit) == GRLIB_side_friendly) then {
stats_blufor_soldiers_killed = stats_blufor_soldiers_killed + 1;
};
};
} else {
if ( typeof _unit in all_hostile_classnames ) then {
if (typeof _unit in all_hostile_classnames) then {
stats_opfor_vehicles_killed = stats_opfor_vehicles_killed + 1;
if ( isplayer _killer ) then {
if (isplayer _killer) then {
stats_opfor_vehicles_killed_by_players = stats_opfor_vehicles_killed_by_players + 1;
};
} else {
@ -86,9 +88,9 @@ if ( isServer ) then {
};
};
if( isServer && !isplayer _unit) then {
if ( ((typeof _unit) == KP_liberation_ammo_crate) && ((getPosATL _unit) select 2 < 10) ) then {
( "R_80mm_HE" createVehicle (getPosATL _unit) ) setVelocity [0, 0, -200];
if (isServer && !isplayer _unit) then {
if (((typeof _unit) == KP_liberation_ammo_crate) && ((getPosATL _unit) select 2 < 10)) then {
("R_80mm_HE" createVehicle (getPosATL _unit)) setVelocity [0, 0, -200];
deleteVehicle _unit;
} else {
sleep GRLIB_cleanup_delay;

View File

@ -172,6 +172,7 @@ class Missions
* Fixed: It was possible to disassemble a mortar in preview.
* Fixed: Preview vehicles could get saved if you shut down the mission right after canceling the build process or if you'd still the preview in front you.
* Fixed: Small issues due to the default "hold fire" combat mode for AI.
* Fixed: Single Infantry units weren't saved sometimes.
### 0.955 (24th June 2017)
* Added: Some small aesthetic things for the buildlist