Jump to content

[bug] Medic doesn't count as medic when in vehicle


Recommended Posts

what about such patch

 

 

diff --git a/=BTC=_revive/=BTC=_functions.sqf b/=BTC=_revive/=BTC=_functions.sqf
index 12d93af..6c200c6 100644
--- a/=BTC=_revive/=BTC=_functions.sqf
+++ b/=BTC=_revive/=BTC=_functions.sqf
@@ -440,6 +440,16 @@ BTC_check_healer =
 	_men = [];_dist = 501;_healer = objNull;_healers = [];
 	_msg = "No medics nearby.";
 	_men = nearestObjects [_pos, BTC_who_can_revive, 500];
+	
+	if ( count _men == 0 ) then {
+		_vehs = [];
+		_vehs = nearestObjects[ _pos, ["AllVehicles"], 500 ];
+		{ { if ( typeOf _x in BTC_who_can_revive ) then { 
+			_men set [count _men, _x]; 
+		} } foreach crew _x; } foreach _vehs;
+	};
+	
+	
 	if (count _men > 0) then
 	{
 		{if (Alive _x && format ["%1",_x getVariable "BTC_need_revive" select 0] != "1" && ([_x,player] call BTC_can_revive) && isPlayer _x && side _x == BTC_side) then {_healers = _healers + [_x];};} foreach _men; 
Link to comment
Share on other sites

no, in fact i want that someone more familar with testing and running mission test it carefully

also AllVehicles is quite wide class, maybe

 

["Car", "Motorcycle", "Tank", "Helicopter", "Plane", "Ship"]

would be more suitable.

Link to comment
Share on other sites

to avoid temporary useless variables:

if ( count _men == 0 ) then {
    { { if ( typeOf _x in BTC_who_can_revive ) then {
        _men set [count _men, _x]; 
    } } foreach crew _x; } foreach nearestObjects[ _pos, ["Car", "Motorcycle", "Tank", "Helicopter", "Plane", "Ship"], 500 ];
};
Link to comment
Share on other sites

This is an issue we'll fix in I&A 3, but we'll be using an entirely different revive system so we won't have to work around this messy code.

 

In the mean time, however, I'd shy away calling nearestObjects; it's a particularly heavy call anyway and running that on each client every frame is gonna sap a good few FPS for players.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Forum Statistics

    11.1k
    Total Topics
    66.5k
    Total Posts
×
×
  • Create New...