mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-13 19:52:57 +03:00
Move study body back to fn_selfActions
Adding UserActions to players (CAManBase) is not efficient, because the
condition evaluates onEachFrame when you are "inside" that vehicle type.
Also admins usually want to add more custom actions to dead bodies
anyway.
https://community.bistudio.com/wiki/addAction#Syntax
This partially reverts 3aad4b6.
This commit is contained in:
@@ -8,22 +8,6 @@ class CAManBase: Man //includes all skins except animals
|
||||
class HitHead;
|
||||
class HitBody;
|
||||
};
|
||||
class UserActions
|
||||
{
|
||||
class StudyBody
|
||||
{
|
||||
displayName = $STR_ACTION_STUDYBODY;
|
||||
displayNameDefault = $STR_ACTION_STUDYBODY;
|
||||
priority = 0;
|
||||
radius = 3;
|
||||
position = "";
|
||||
showWindow = 0;
|
||||
onlyForPlayer = 1;
|
||||
shortcut = "";
|
||||
condition = "(['StudyBody',this] call userActionConditions)";
|
||||
statement = "this call player_studyBody;";
|
||||
};
|
||||
};
|
||||
};
|
||||
class Civilian: CAManBase
|
||||
{
|
||||
|
||||
@@ -73,7 +73,6 @@ class zZombie_Base : Zed_Base {
|
||||
condition = "(['Butcher',this] call userActionConditions)";
|
||||
statement = "this spawn player_butcher;";
|
||||
};
|
||||
delete StudyBody;
|
||||
};
|
||||
|
||||
class HitPoints {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
private["_body","_name","_method","_methodStr","_message","_killingBlow"];
|
||||
|
||||
_body = _this;
|
||||
_body = _this select 3;
|
||||
_name = _body getVariable["bodyName","unknown"];
|
||||
_method = _body getVariable["deathType","unknown"];
|
||||
_methodStr = localize format ["str_death_%1",_method];
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define IS_PZOMBIE (player isKindOf "PZombie_VB")
|
||||
|
||||
/*
|
||||
(['StudyBody',this] call userActionConditions)
|
||||
(['Butcher',this] call userActionConditions)
|
||||
|
||||
Return - must be true for action to show.
|
||||
*/
|
||||
@@ -17,7 +17,6 @@ _action = _this select 0;
|
||||
_object = _this select 1;
|
||||
|
||||
_show = switch _action do {
|
||||
case "StudyBody": {!IS_ALIVE};
|
||||
case "Butcher": {!IS_ALIVE && !IN_VEHICLE && CAN_DO && !(_object getVariable["meatHarvested",false]) && !IS_PZOMBIE};
|
||||
case "Drink": {!IN_VEHICLE && CAN_DO && !dayz_isSwimming};
|
||||
case "PushPlane": {IS_ALIVE && !IN_VEHICLE && CAN_DO && count crew _object == 0 && !isEngineOn _object && !IS_PZOMBIE};
|
||||
|
||||
@@ -476,6 +476,16 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
player removeAction s_player_sleep;
|
||||
s_player_sleep = -1;
|
||||
};
|
||||
|
||||
//Study Body
|
||||
if (_cursorTarget getVariable["bodyName",""] != "") then {
|
||||
if (s_player_studybody < 0) then {
|
||||
s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true];
|
||||
};
|
||||
} else {
|
||||
player removeAction s_player_studybody;
|
||||
s_player_studybody = -1;
|
||||
};
|
||||
/*
|
||||
//Carbomb
|
||||
_hasCarBomb = "ItemCarBomb" in _magazinesPlayer;
|
||||
@@ -1038,6 +1048,8 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
s_player_packtentinfected = -1;
|
||||
player removeAction s_player_fillfuel;
|
||||
s_player_fillfuel = -1;
|
||||
player removeAction s_player_studybody;
|
||||
s_player_studybody = -1;
|
||||
//fuel
|
||||
player removeAction s_player_fillfuel210;
|
||||
s_player_fillfuel210 = -1;
|
||||
|
||||
@@ -123,7 +123,6 @@ if (!isDedicated) then {
|
||||
player_pushPlane = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_pushPlane.sqf";
|
||||
//player_repairVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\repair_vehicle.sqf";
|
||||
//player_salvageVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\salvage_vehicle.sqf";
|
||||
player_studyBody = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\study_body.sqf";
|
||||
|
||||
//ui
|
||||
player_toggleSoundMute = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_toggleSoundMute.sqf";
|
||||
|
||||
@@ -177,6 +177,7 @@ dayz_resetSelfActions = {
|
||||
s_player_grabflare = -1;
|
||||
s_player_removeflare = -1;
|
||||
s_player_painkiller = -1;
|
||||
s_player_studybody = -1;
|
||||
s_build_Sandbag1_DZ = -1;
|
||||
s_build_Hedgehog_DZ = -1;
|
||||
s_build_Wire_cat1 = -1;
|
||||
|
||||
Reference in New Issue
Block a user