Fix "AI" text localization again

This was my mistake from 131329f. SourceName needs to be checked, not
bodyName.
This commit is contained in:
ebaydayz
2017-01-19 17:36:26 -05:00
parent 194bad12ea
commit d8828d9df1
3 changed files with 24 additions and 10 deletions

View File

@@ -1,14 +1,19 @@
private ["_bodyName","_root","_type","_weapon"];
private ["_bodyName","_root","_sourceName","_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": {
_sourceName = _message select 2;
_weapon = _message select 3;
if (_sourceName == "AI") then {
_sourceName = localize "STR_PLAYER_AI";
};
_root = switch true do {
case (_weapon in ["PipeBomb","Mine","MineE"]): {"CfgMagazines"}; // isClass in both
case (isClass (configFile >> "CfgWeapons" >> _weapon)): {"CfgWeapons"};
@@ -16,14 +21,19 @@ _message = switch _type do {
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]
if (DZE_DeathMsgDynamicText) then {
_message call dayz_killFeed;
};
format [localize "str_player_death_killed",_bodyName,_sourceName,_message select 3,_message select 4]
};
case "suicide": {format [localize "str_player_death_suicide",_bodyName]};
};

View File

@@ -41,7 +41,7 @@ if (!isNull _source) then {
//Send Death Notice
diag_log format["Player_Death: Body:%1 BodyName:%2 Infected:%3 SourceName:%4 SourceWeapon:%5 Distance:%6 Method:%7",_body,dayz_playerName,_infected,_sourceName,_sourceWeapon,_distance,_method];
PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID,toArray dayz_playerName,_infected,toArray _sourceName,toArray _sourceWeapon,_distance,toArray _method]; //Send name as array to avoid publicVariable value restrictions
PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID,toArray dayz_playerName,_infected,toArray _sourceName,toArray _sourceWeapon,_distance,_method]; //Send name as array to avoid publicVariable value restrictions
publicVariableServer "PVDZ_plr_Death";
_body setVariable ["deathType",_method,true];