mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Fix "AI" text localization again
This was my mistake from 131329f. SourceName needs to be checked, not
bodyName.
This commit is contained in:
@@ -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]};
|
||||
};
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#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","_bodyName"];
|
||||
private ["_characterID","_minutes","_newObject","_playerID","_playerName","_key","_pos","_infected","_sourceName","_sourceWeapon","_distance","_message","_method","_suicide","_bodyName","_type"];
|
||||
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
|
||||
|
||||
_characterID = _this select 0;
|
||||
@@ -12,7 +12,7 @@ _infected = _this select 5;
|
||||
_sourceName = toString (_this select 6);
|
||||
_sourceWeapon = toString (_this select 7);
|
||||
_distance = _this select 8;
|
||||
_method = toString (_this select 9);
|
||||
_method = _this select 9;
|
||||
|
||||
//Mark player as dead so we bypass the ghost system
|
||||
dayz_died set [count dayz_died, _playerID];
|
||||
@@ -65,16 +65,20 @@ if (_playerName != "unknown" or _sourceName != "unknown") then {
|
||||
//Don't use regular PV here since JIP clients don't need it
|
||||
owner _newObject publicVariableClient "PVDZE_deathMessage"; //Send to dead player (not in playableUnits)
|
||||
{
|
||||
if (isPlayer _x) then {
|
||||
if !(getPlayerUID _x in ["",_playerID]) then {
|
||||
owner _x publicVariableClient "PVDZE_deathMessage";
|
||||
};
|
||||
} count playableUnits;
|
||||
};
|
||||
|
||||
_type = _message select 0;
|
||||
_bodyName = _message select 1;
|
||||
if (_bodyName == "AI") then {_bodyName = localize "STR_PLAYER_AI";};
|
||||
|
||||
_message = switch (_message select 0) do {
|
||||
if (_type == "killed" && _sourceName == "AI") then {
|
||||
_message set [2, (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": {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]};
|
||||
|
||||
Reference in New Issue
Block a user