Skip to content

Commit

Permalink
Corrected marker handling for different sides in the TT version
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeno69 committed Feb 13, 2021
1 parent daa82ff commit bd08865
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 74 deletions.
7 changes: 0 additions & 7 deletions co30_Domination.Altis/client/fn_delmaloc.sqf

This file was deleted.

28 changes: 28 additions & 0 deletions co30_Domination.Altis/client/fn_setupplayer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ if (side (group player) == blufor) then {

d_UAV_Small = "B_UAV_01_F";
d_UAV_Terminal = "B_UavTerminal";
if (didJIP) then {
{
deleteMarkerLocal _x;
} forEach (allMapMarkers select {_x select [0, 9] == "d_bm_opf_" || {_x select [0, 9] == "d_ab_opf_" || {_x select [0, 10] == "d_abm_opf_" || {_x select [0, 9] == "d_Mash_opf" || {_x select [0, 9] == "d_FARP_opf" || {_x select [0, 12] == "xr_opf_dead_"}}}}}});
{
(_x splitString "|") params ["", "_netid_ar"];
if (_netid_ar != "") then {
private _obj = objectFromNetId _netid_ar;
if (side (group _obj) != d_player_side) then {
deleteMarkerLocal _x;
};
};
} forEach (allMapMarkers select {_x select [0, 9] == "d_arttmx|"});
};
} else {
d_mob_respawns = d_mob_respawns_opfor;
d_player_side = opfor;
Expand All @@ -54,6 +68,20 @@ if (side (group player) == blufor) then {

d_UAV_Small = "O_UAV_01_F";
d_UAV_Terminal = "O_UavTerminal";
if (didJIP) then {
{
deleteMarkerLocal _x;
} forEach (allMapMarkers select {_x select [0, 9] == "d_bm_blu_" || {_x select [0, 9] == "d_ab_blu_" || {_x select [0, 10] == "d_abm_blu_" || {_x select [0, 9] == "d_Mash_blu" || {_x select [0, 9] == "d_FARP_blu" || {_x select [0, 12] == "xr_blu_dead_"}}}}}});
{
(_x splitString "|") params ["", "_netid_ar"];
if (_netid_ar != "") then {
private _obj = objectFromNetId _netid_ar;
if (side (group _obj) != d_player_side) then {
deleteMarkerLocal _x;
};
};
} forEach (allMapMarkers select {_x select [0, 9] == "d_arttmx|"});
};
};
d_side_player = d_player_side;
d_can_call_drop_ar = [];
Expand Down
5 changes: 5 additions & 0 deletions co30_Domination.Altis/client/fn_spawn_farp.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ d_farps pushBack _farp;
publicVariable "d_farps";

systemChat (localize "STR_DOM_MISSIONSTRING_248");
#ifndef __TT__
["a", d_player_uid, [_farp, "d_FARP " + (netId player), d_name_pl, player, d_player_side]] remoteExecCall ["d_fnc_p_o_ar", 2];
#else
private _mbegin = ["d_FARP_opf ", "d_FARP_blu "] select (d_player_side == blufor);
["a", d_player_uid, [_farp, _mbegin + (netId player), d_name_pl, player, d_player_side]] remoteExecCall ["d_fnc_p_o_ar", 2];
#endif
if (isMultiplayer) then {
[_farp, player] remoteExecCall ["d_fnc_farp_e", d_player_side];
} else {
Expand Down
5 changes: 5 additions & 0 deletions co30_Domination.Altis/client/fn_spawn_mash.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ publicVariable "d_mashes";

systemChat (localize "STR_DOM_MISSIONSTRING_285");

#ifndef __TT__
["a", d_player_uid, [_medic_tent, "d_Mash " + (netId player), d_name_pl, player, d_player_side]] remoteExecCall ["d_fnc_p_o_ar", 2];
#else
private _mbegin = ["d_Mash_opf ", "d_Mash_blu "] select (d_player_side == blufor);
["a", d_player_uid, [_medic_tent, _mbegin + (netId player), d_name_pl, player, d_player_side]] remoteExecCall ["d_fnc_p_o_ar", 2];
#endif

_medic_tent setVariable ["d_owner", player, true];

Expand Down
1 change: 0 additions & 1 deletion co30_Domination.Altis/description.ext
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ class CfgRemoteExec {
class d_fnc_ttpvkill {allowedTargets = 2;};
class d_fnc_lastchanceclient {allowedTargets = 1;};
class d_fnc_asfnc {allowedTargets = 2;};
class d_fnc_delmaloc {allowedTargets = 2; jip = 1;};
#endif
};
// List of script commands allowed to be sent from client via remoteExec
Expand Down
Binary file modified co30_Domination.Altis/mission.sqm
Binary file not shown.
9 changes: 7 additions & 2 deletions co30_Domination.Altis/revive/fn_addmarker.sqf
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
// by Xeno
//#define __DEBUG__
#define THIS_FILE "fn_addmarker.sqf"
#include "..\x_macros.sqf"
#include "..\x_setup.sqf"

if (!isServer) exitWith {};

__TRACE_1("","_this")
params ["_unit"];
if (!alive _unit) exitWith {};
#ifndef __TT__
private _mname = format ["xr_dead_%1", getPlayerID _unit];
#else
private _mbegin = ["xr_opf_dead_%1", "xr_blu_dead_%1"] select (side (group _unit) == blufor);
private _mname = format [_mbegin, getPlayerID _unit];
#endif
__TRACE_1("","_mname")
if (markerPos _mname isEqualTo [0,0,0]) then {
[_mname, _this # 1, "ICON", "ColorBlue", [0.4,0.4], format [localize "STR_DOM_MISSIONSTRING_910", name _unit], 0, "KIA"] call d_fnc_CreateMarkerGlobal;
#ifdef __TT__
_unit setVariable ["xr_dml_jip_id", [_mname, side (group _unit)] remoteExecCall ["d_fnc_delmaloc", 0, _unit]];
_mname remoteExecCall ["deleteMarkerLocal", [blufor, opfor] select (side (group _unit) == blufor)];
#endif
};
4 changes: 0 additions & 4 deletions co30_Domination.Altis/revive/fn_uncon.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ __TRACE("starting main uncon loop")
if (xr_with_marker) then {
__TRACE("del marker")
xr_strpldead remoteExecCall ["deleteMarker", 2];
private _jipid = player getVariable "xr_dml_jip_id";
if (!isNil "_jipid") then {
remoteExecCall ["", _jipid];
};
};
__TRACE("set capture false player")
player setCaptive false;
Expand Down
4 changes: 0 additions & 4 deletions co30_Domination.Altis/revive/fn_uncon_oneframe.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ if (_tt <= 0) exitWith {
__TRACE("_tt < =0, exit")
if (xr_with_marker) then {
xr_strpldead remoteExecCall ["deleteMarker", 2];
private _jipid = player getVariable "xr_dml_jip_id";
if (!isNil "_jipid") then {
remoteExecCall ["", _jipid];
};
};
{
player remoteExecCall ["xr_fnc_removeActions", _x];
Expand Down
7 changes: 6 additions & 1 deletion co30_Domination.Altis/revive/init.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// by Xeno
//#define __DEBUG__
#define THIS_FILE "revive\init.sqf"
#include "..\x_macros.sqf"
#include "..\x_setup.sqf"

if (!hasInterface) exitWith {};

Expand All @@ -26,7 +26,12 @@ xr_death_pos = [];
private _grpl = group player;
xr_side_pl = [playerSide, side _grpl] select (!isNull _grpl);

#ifndef __TT__
xr_strpldead = format ["xr_dead_%1", getPlayerID player];
#else
private _mbegin = ["xr_opf_dead_%1", "xr_blu_dead_%1"] select (xr_side_pl == blufor);
xr_strpldead = format [_mbegin, getPlayerID player];
#endif

player addEventHandler ["killed", {call xr_fnc_killedEH}];

Expand Down
9 changes: 7 additions & 2 deletions co30_Domination.Altis/scripts/fn_mando_chute.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,16 @@ if (_is_ammo) then {
_box addEventHandler ["killed",{
deleteVehicle (_this # 0);
}];
#ifndef __TT__
private _mname = format ["d_ab_%1", _box call d_fnc_markername];
[_mname, _box, "ICON", "ColorBlue", [0.5, 0.5], localize "STR_DOM_MISSIONSTRING_523", 0, d_dropped_box_marker] call d_fnc_CreateMarkerGlobal;
_box setVariable ["d_mname", _mname];
#ifdef __TT__
[_mname, _pside] remoteExecCall ["d_fnc_delmaloc", 0, _box];
#else
private _mbegin = ["d_ab_opf_%1", "d_ab_blu_%1"] select (_pside == blufor);
private _mname = format [_mbegin, _box call d_fnc_markername];
[_mname, _box, "ICON", "ColorBlue", [0.5, 0.5], localize "STR_DOM_MISSIONSTRING_523", 0, d_dropped_box_marker] call d_fnc_CreateMarkerGlobal;
_mname remoteExecCall ["deleteMarkerLocal", [blufor, opfor] select (_pside == blufor)];
_box setVariable ["d_mname", _mname];
#endif
} else {
if (position _man # 2 <= -1) then {
Expand Down
6 changes: 0 additions & 6 deletions co30_Domination.Altis/server/fn_arifire.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,6 @@ _logic1 kbTell [_aop, _topicside_arti, "ArtilleryComplete", ["1","",_aristr,[]],

if (markerPos _sel_ari_mkr isNotEqualTo [0,0,0] && {_ari_tgt_pos isEqualTo (markerPos _sel_ari_mkr)}) then {
deleteMarker _sel_ari_mkr;
#ifdef __TT__
private _jipid = _aop getVariable "d_artmark_jip_id";
if (!isNil "_jipid") then {
remoteExecCall ["", _jipid];
};
#endif
};

#ifndef __TT__
Expand Down
6 changes: 1 addition & 5 deletions co30_Domination.Altis/server/fn_at_serv.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ if (_pa isNotEqualTo []) then {
};
[_mname, _apos, "ICON", d_color_m_marker, [1, 1], _npl, 0, d_arty_m_marker] call d_fnc_CreateMarkerGlobal;
#ifdef __TT__
private _jipid = _pl getVariable "d_artmark_jip_id";
if (!isNil "_jipid") then {
remoteExecCall ["", _jipid];
};
_pl setVariable ["d_artmark_jip_id", [_mname, side (group _pl)] remoteExecCall ["d_fnc_delmaloc", 0, _pl]];
_mname remoteExecCall ["deleteMarkerLocal", [blufor, opfor] select (side (group _pl) == blufor)];
#endif

if (d_no_ai) then {
Expand Down
6 changes: 4 additions & 2 deletions co30_Domination.Altis/server/fn_createdroppedbox.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@ if (!isNil "_percent") then {
_box setVariable ["d_abox_perc", _percent, true];
(_this # 1) setVariable ["d_abox_perc", nil, true];
};
private _mname = format ["d_bm_%1", _box call d_fnc_markername];
#ifndef __TT__
private _mname = format ["d_bm_%1", _box call d_fnc_markername];
d_ammo_boxes pushBack [d_dbox_idx, _box, _mname];
_box setVariable ["d_box_params", [d_dbox_idx, _box, _mname]]:
#else
private _mbegin = ["d_bm_opf_%1", "d_bm_blu_%1"] select (_this # 2 == blufor);
private _mname = format [_mbegin, _box call d_fnc_markername];
d_ammo_boxes pushBack [d_dbox_idx, _box, _mname, _this # 2];
_box setVariable ["d_box_params", [d_dbox_idx, _box, _mname, _this # 2]];
#endif
publicVariable "d_ammo_boxes";
d_dbox_idx = d_dbox_idx + 1;
[_mname, _box, "ICON", "ColorBlue", [0.5, 0.5], localize "STR_DOM_MISSIONSTRING_523", 0, d_dropped_box_marker] call d_fnc_CreateMarkerGlobal;
#ifdef __TT__
[_mname, _this # 2] remoteExecCall ["d_fnc_delmaloc", 0, _box];
_mname remoteExecCall ["deleteMarkerLocal", [blufor, opfor] select ((_this # 2) == blufor)];
#endif
if (d_with_ace) then {
[_box, _mname] spawn d_fnc_moveboxm;
Expand Down
5 changes: 4 additions & 1 deletion co30_Domination.Altis/server/fn_handledisconnect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ if (_pa isNotEqualTo []) then {
if ((_pa # 9) # 1 == 0) then {
_pa set [9, [(_pa # 9) # 0, time]];
};
#endif
deleteMarker format ["xr_opf_dead_%1", _pa # 18];
deleteMarker format ["xr_blu_dead_%1", _pa # 18];
#else
deleteMarker format ["xr_dead_%1", _pa # 18];
#endif
private _amark = _pa # 10;
__TRACE_1("","_amark")
if (_amark != "") then {
Expand Down
4 changes: 2 additions & 2 deletions co30_Domination.Altis/server/fn_p_o_ar.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ call {
if ((_ar # 0) isKindOf d_mash) then {
[_ar # 1, _ar # 0, "ICON", "ColorBlue", [0.5, 0.5], format ["Mash %1", _ar # 2], 0, "mil_dot"] call d_fnc_CreateMarkerGlobal;
#ifdef __TT__
[_ar # 1, _ar # 4] remoteExecCall ["d_fnc_delmaloc", [0, -2] select isDedicated];
(_ar # 1) remoteExecCall ["deleteMarkerLocal", [blufor, opfor] select ((_ar # 4) == blufor)];
#endif
} else {
if ((_ar # 0) isKindOf (d_farp_classes # 0)) then {
[_ar # 1, _ar # 0, "ICON", "ColorBlue", [0.5, 0.5], format ["FARP %1", _ar # 2], 0, "mil_dot"] call d_fnc_CreateMarkerGlobal;
#ifdef __TT__
[_ar # 1, _ar # 4] remoteExecCall ["d_fnc_delmaloc", [0, -2] select isDedicated];
(_ar # 1) remoteExecCall ["deleteMarkerLocal", [blufor, opfor] select ((_ar # 4) == blufor)];
#endif
};
};
Expand Down
6 changes: 0 additions & 6 deletions co30_Domination.Altis/server/fn_sgetinvec.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,3 @@ if (!isNil "_ma") then {
deleteMarker _ma;
(_this # 0) setVariable ["d_abandoned_ma", nil];
};
#ifdef __TT__
private _jid = (_this # 0) getVariable "d_bandoned_ma_jipid";
if (!isNil "_jid") then {
remoteExecCall ["", _jid];
};
#endif
8 changes: 5 additions & 3 deletions co30_Domination.Altis/server/fn_sgetoutvec.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@
params ["_vec"];
#ifndef __TT__
if (alive _vec && {(crew _vec) findIf {alive _x} == -1 && {_vec distance2D d_FLAG_BASE > 800}}) then {
private _mname = format ["%1_ab%2", _vec call d_fnc_markername, time];
#else
private _vside = _vec getVariable "D_VEC_SIDE";
if (alive _vec && {(crew _vec) findIf {alive _x} == -1 && {_vside == 2 && {_vec distance2D d_WFLAG_BASE > 800} || {_vside == 1 && {_vec distance2D d_EFLAG_BASE > 800}}}}) then {
private _mbegin = ["d_abm_blu_%1_%2", "d_abm_opf_%1_%2"] select (_vside == 1);
private _mname = format [_mbegin, _vec call d_fnc_markername, time];
#endif
private _mname = format ["%1_ab%2", _vec call d_fnc_markername, time];
[_mname, _vec, "ICON", "ColorBlue", [1,1], format [localize "STR_DOM_MISSIONSTRING_1566", [_vec] call d_fnc_GetDisplayName], 0, "mil_triangle"] call d_fnc_CreateMarkerGlobal;
_vec setVariable ["d_abandoned_ma", _mname];
#ifdef __TT__
if (_vside == 1) then {
_vec setVariable ["d_bandoned_ma_jipid", [_mname, east] remoteExecCall ["d_fnc_delmaloc", 0, _vec]];
_mname remoteExecCall ["deleteMarkerLocal", blufor];
} else {
_vec setVariable ["d_bandoned_ma_jipid", [_mname, west] remoteExecCall ["d_fnc_delmaloc", 0, _vec]];
_mname remoteExecCall ["deleteMarkerLocal", opfor];
};
#endif
};
58 changes: 30 additions & 28 deletions dom_maker/make_dom.bat
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,36 @@ makePbo -AJNP %NEW_VER%
rmdir /S /Q %NEW_VER%


rem TT Tanoa
set NEW_VER=tvt%D_NUM_PLAYERS_TT%_domination_%D_VER%_tt.tanoa
set MISSION_SQM=..\mission_sqm\mission_tt_tanoa_bin.sqm
set X_SETUP=..\mission_sqm\x_setup_tt_tanoa.sqf
md %NEW_VER%
xcopy %MASTER%\*.* %NEW_VER% /E /Y
echo d | xcopy %MISSION_SQM% %NEW_VER%\mission.sqm /Y
echo d | xcopy %X_SETUP% %NEW_VER%\x_setup.sqf /Y
cd %NEW_VER%
del i_weapons_rhs.sqf
del i_weapons_CUP.sqf
del i_weapons_IFA3.sqf
del i_weapons_gmcwg.sqf
del i_weapons_UNSUNG.sqf
del i_weapons_csla.sqf
cd missions
rmdir /S /Q m
rmdir /S /Q moa
rmdir /S /Q msara
rmdir /S /Q ma3a
rmdir /S /Q ma3s
rmdir /S /Q mifa3
rmdir /S /Q ma3m
cd ..
cd ..
makePbo -AJNP %NEW_VER%
rmdir /S /Q %NEW_VER%



rem Blufor Stratis
set NEW_VER=co%D_NUM_PLAYERS%_domination_%D_VER%_blufor.stratis
set MISSION_SQM=..\mission_sqm\mission_blufor_stratis_bin.sqm
Expand Down Expand Up @@ -657,34 +687,6 @@ cd ..
makePbo -AJNP %NEW_VER%
rmdir /S /Q %NEW_VER%

rem TT Tanoa
set NEW_VER=tvt%D_NUM_PLAYERS_TT%_domination_%D_VER%_tt.tanoa
set MISSION_SQM=..\mission_sqm\mission_tt_tanoa_bin.sqm
set X_SETUP=..\mission_sqm\x_setup_tt_tanoa.sqf
md %NEW_VER%
xcopy %MASTER%\*.* %NEW_VER% /E /Y
echo d | xcopy %MISSION_SQM% %NEW_VER%\mission.sqm /Y
echo d | xcopy %X_SETUP% %NEW_VER%\x_setup.sqf /Y
cd %NEW_VER%
del i_weapons_rhs.sqf
del i_weapons_CUP.sqf
del i_weapons_IFA3.sqf
del i_weapons_gmcwg.sqf
del i_weapons_UNSUNG.sqf
del i_weapons_csla.sqf
cd missions
rmdir /S /Q m
rmdir /S /Q moa
rmdir /S /Q msara
rmdir /S /Q ma3a
rmdir /S /Q ma3s
rmdir /S /Q mifa3
rmdir /S /Q ma3m
cd ..
cd ..
makePbo -AJNP %NEW_VER%
rmdir /S /Q %NEW_VER%

rem TT Malden
set NEW_VER=tvt%D_NUM_PLAYERS_TT%_domination_%D_VER%_tt.malden
set MISSION_SQM=..\mission_sqm\mission_tt_malden_bin.sqm
Expand Down

0 comments on commit bd08865

Please sign in to comment.