mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Fix "AI" text localized on wrong client in death message #1867
Fixes #1867
This commit is contained in:
@@ -56,6 +56,7 @@
|
|||||||
[FIXED] Unable to remove LightPole_DZ, DeerStand_DZ, MetalGate_DZ and StickFence_DZ. #1859 @TheZog
|
[FIXED] Unable to remove LightPole_DZ, DeerStand_DZ, MetalGate_DZ and StickFence_DZ. #1859 @TheZog
|
||||||
[FIXED] Unconscious locked input when running #1860 @icomrade @DeVloek
|
[FIXED] Unconscious locked input when running #1860 @icomrade @DeVloek
|
||||||
[FIXED] Running corpses when the dead player has no primary weapon @icomrade
|
[FIXED] Running corpses when the dead player has no primary weapon @icomrade
|
||||||
|
[FIXED] "AI" text localized on wrong client in death messages. #1867 @LunaCB
|
||||||
|
|
||||||
[NOTE] The fixes below are included in the 1.0.6 Build C server package released December 29th, 2016 (http://dayzepoch.com/a2dayzepoch.php)
|
[NOTE] The fixes below are included in the 1.0.6 Build C server package released December 29th, 2016 (http://dayzepoch.com/a2dayzepoch.php)
|
||||||
[FIXED] Hive child 309 errors that resulted in broken saving of newly built storage object inventory. @icomrade
|
[FIXED] Hive child 309 errors that resulted in broken saving of newly built storage object inventory. @icomrade
|
||||||
|
|||||||
42
SQF/dayz_code/compile/dze_deathMessage.sqf
Normal file
42
SQF/dayz_code/compile/dze_deathMessage.sqf
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
private ["_bodyName","_root","_type","_weapon"];
|
||||||
|
|
||||||
|
_message = _this;
|
||||||
|
_type = _message select 0;
|
||||||
|
_bodyName = _message select 1;
|
||||||
|
if (_bodyName == "AI") then {_bodyName = localize "STR_PLAYER_AI";};
|
||||||
|
|
||||||
|
_message = switch _type do {
|
||||||
|
case "died": {format [localize "str_player_death_died",_bodyName,localize format["str_death_%1",_message select 2]]};
|
||||||
|
case "killed": {
|
||||||
|
_weapon = _message select 3;
|
||||||
|
_root = switch true do {
|
||||||
|
case (_weapon in ["PipeBomb","Mine","MineE"]): {"CfgMagazines"}; // isClass in both
|
||||||
|
case (isClass (configFile >> "CfgWeapons" >> _weapon)): {"CfgWeapons"};
|
||||||
|
case (isClass (configFile >> "CfgVehicles" >> _weapon)): {"CfgVehicles"};
|
||||||
|
case (isClass (configFile >> "CfgMagazines" >> _weapon)): {"CfgMagazines"};
|
||||||
|
default {""};
|
||||||
|
};
|
||||||
|
if (_root == "") then {
|
||||||
|
_message set [5,""];
|
||||||
|
} else {
|
||||||
|
_message set [3,getText (configFile >> _root >> _weapon >> "displayName")];
|
||||||
|
_message set [5,getText (configFile >> _root >> _weapon >> "picture")];
|
||||||
|
};
|
||||||
|
if (DZE_DeathMsgDynamicText) then {_message call dayz_killFeed};
|
||||||
|
format [localize "str_player_death_killed",_bodyName,_message select 2,_message select 3,_message select 4]
|
||||||
|
};
|
||||||
|
case "suicide": {format [localize "str_player_death_suicide",_bodyName]};
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (toLower DZE_DeathMsgChat) do {
|
||||||
|
// Sending from logic (FunctionsManager) or agent (zombie, animal, trader) object shows message without side i.e. "BLUFOR" or quotes
|
||||||
|
case "global": {BIS_functions_mainscope globalChat _message;};
|
||||||
|
case "side": {BIS_functions_mainscope sideChat _message;};
|
||||||
|
case "system": {systemChat _message;};
|
||||||
|
};
|
||||||
|
|
||||||
|
if (DZE_DeathMsgRolling) then {
|
||||||
|
_message call dayz_rollingMessages;
|
||||||
|
};
|
||||||
|
|
||||||
|
diag_log format["DeathMessage: %1",_message];
|
||||||
@@ -34,7 +34,7 @@ if (!isNull _source) then {
|
|||||||
if (_sourceWeapon == "Throw") then {_sourceWeapon = (weaponState _source) select 3;};
|
if (_sourceWeapon == "Throw") then {_sourceWeapon = (weaponState _source) select 3;};
|
||||||
if (_ammo in ["PipeBomb","Mine","MineE"]) then {_sourceWeapon = _ammo;};
|
if (_ammo in ["PipeBomb","Mine","MineE"]) then {_sourceWeapon = _ammo;};
|
||||||
if (alive _source) then {
|
if (alive _source) then {
|
||||||
_sourceName = if (isPlayer _source) then {name _source} else {localize "STR_PLAYER_AI"};
|
_sourceName = if (isPlayer _source) then {name _source} else {"AI"};
|
||||||
};
|
};
|
||||||
if (_source == _body) then {_sourceName = dayz_playerName;};
|
if (_source == _body) then {_sourceName = dayz_playerName;};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ if (!isDedicated) then {
|
|||||||
// EPOCH ADDITIONS
|
// EPOCH ADDITIONS
|
||||||
dayz_autoRunOff = {dayz_autoRun = false; terminate dayz_autoRunThread; player playActionNow "Stop";};
|
dayz_autoRunOff = {dayz_autoRun = false; terminate dayz_autoRunThread; player playActionNow "Stop";};
|
||||||
dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
|
dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
|
||||||
|
dze_deathMessage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_deathMessage.sqf";
|
||||||
dze_filterCheats = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_filterCheats.sqf";
|
dze_filterCheats = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_filterCheats.sqf";
|
||||||
dze_isnearest_player = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_isNearestPlayer.sqf";
|
dze_isnearest_player = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_isNearestPlayer.sqf";
|
||||||
dze_buildChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_buildChecks.sqf";
|
dze_buildChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_buildChecks.sqf";
|
||||||
|
|||||||
@@ -327,41 +327,7 @@ if (!isDedicated) then {
|
|||||||
format[localize "STR_BLD_COMBO_SET",_codeGuess] call dayz_rollingMessages;
|
format[localize "STR_BLD_COMBO_SET",_codeGuess] call dayz_rollingMessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
// EPOCH ADDITION
|
"PVDZE_deathMessage" addPublicVariableEventHandler {(_this select 1) call dze_deathMessage};
|
||||||
"PVDZE_deathMessage" addPublicVariableEventHandler {
|
|
||||||
private ["_root","_weapon"];
|
|
||||||
_message = _this select 1;
|
|
||||||
_message = switch (_message select 0) do {
|
|
||||||
case "died": {format [localize "str_player_death_died",_message select 1,localize format["str_death_%1",_message select 2]]};
|
|
||||||
case "killed": {
|
|
||||||
_weapon = _message select 3;
|
|
||||||
_root = switch true do {
|
|
||||||
case (_weapon in ["PipeBomb","Mine","MineE"]): {"CfgMagazines"}; // isClass in both
|
|
||||||
case (isClass (configFile >> "CfgWeapons" >> _weapon)): {"CfgWeapons"};
|
|
||||||
case (isClass (configFile >> "CfgVehicles" >> _weapon)): {"CfgVehicles"};
|
|
||||||
case (isClass (configFile >> "CfgMagazines" >> _weapon)): {"CfgMagazines"};
|
|
||||||
default {""};
|
|
||||||
};
|
|
||||||
if (_root == "") then {
|
|
||||||
_message set [5,""];
|
|
||||||
} else {
|
|
||||||
_message set [3,getText (configFile >> _root >> _weapon >> "displayName")];
|
|
||||||
_message set [5,getText (configFile >> _root >> _weapon >> "picture")];
|
|
||||||
};
|
|
||||||
if (DZE_DeathMsgDynamicText) then {_message call dayz_killFeed};
|
|
||||||
format [localize "str_player_death_killed",_message select 1,_message select 2,_message select 3,_message select 4]
|
|
||||||
};
|
|
||||||
case "suicide": {format [localize "str_player_death_suicide",_message select 1]};
|
|
||||||
};
|
|
||||||
switch (toLower DZE_DeathMsgChat) do {
|
|
||||||
// Sending from logic (FunctionsManager) or agent (zombie, animal, trader) object shows message without side i.e. "BLUFOR" or quotes
|
|
||||||
case "global": {BIS_functions_mainscope globalChat _message;};
|
|
||||||
case "side": {BIS_functions_mainscope sideChat _message;};
|
|
||||||
case "system": {systemChat _message;};
|
|
||||||
};
|
|
||||||
if (DZE_DeathMsgRolling) then {_message call dayz_rollingMessages;};
|
|
||||||
diag_log format["DeathMessage: %1",_message];
|
|
||||||
};
|
|
||||||
|
|
||||||
// flies and swarm sound sync
|
// flies and swarm sound sync
|
||||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\client_flies.sqf";
|
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\client_flies.sqf";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
||||||
|
|
||||||
private ["_characterID","_minutes","_newObject","_playerID","_playerName","_key","_pos","_infected","_sourceName","_sourceWeapon","_distance","_message","_method","_suicide"];
|
private ["_characterID","_minutes","_newObject","_playerID","_playerName","_key","_pos","_infected","_sourceName","_sourceWeapon","_distance","_message","_method","_suicide","_bodyName"];
|
||||||
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
|
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
|
||||||
|
|
||||||
_characterID = _this select 0;
|
_characterID = _this select 0;
|
||||||
@@ -71,10 +71,13 @@ if (_playerName != "unknown" or _sourceName != "unknown") then {
|
|||||||
} count playableUnits;
|
} count playableUnits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_bodyName = _message select 1;
|
||||||
|
if (_bodyName == "AI") then {_bodyName = localize "STR_PLAYER_AI";};
|
||||||
|
|
||||||
_message = switch (_message select 0) do {
|
_message = switch (_message select 0) do {
|
||||||
case "died": {format [localize "str_player_death_died", _message select 1, localize format["str_death_%1",_message select 2]]};
|
case "died": {format [localize "str_player_death_died", _bodyName, localize format["str_death_%1",_message select 2]]};
|
||||||
case "killed": {format [localize "str_player_death_killed", _message select 1, _message select 2, _message select 3, _message select 4]};
|
case "killed": {format [localize "str_player_death_killed", _bodyName, _message select 2, _message select 3, _message select 4]};
|
||||||
case "suicide": {format [localize "str_player_death_suicide", _message select 1]};
|
case "suicide": {format [localize "str_player_death_suicide", _bodyName]};
|
||||||
};
|
};
|
||||||
diag_log format["DeathMessage: %1",_message];
|
diag_log format["DeathMessage: %1",_message];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user