Skip to content

Commit

Permalink
Change all getPos to getPosATL (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
3Mydlo3 authored Apr 4, 2024
1 parent 5aed975 commit eb4f0fb
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion addons/civilian/functions/fnc_civilianKilledMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ params ["_unit", "_time"];

private _markerName = format ["killed_civilian_%1_%2", _unit];
private _markerText = format ["%1", _time];
private _marker = createMarker [_markerName, getpos _unit];
private _marker = createMarker [_markerName, getPosATL _unit];
_marker setMarkerType "mil_objective";
_marker setMarkerColor "ColorEAST";
_marker setMarkerSize [0.4, 0.4];
Expand Down
2 changes: 1 addition & 1 deletion addons/civilian/functions/fnc_getNearestCity.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
params ["_position", ["_searchRadius", 2000]];

if (_position isEqualType objNull) then {
_position = getPos _position;
_position = getPosATL _position;
};

// Find nearest city location
Expand Down
2 changes: 1 addition & 1 deletion addons/civilian/functions/fnc_getNearestVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
params ["_pos", ["_radius", 500], ["_filterFunction", {true}]];

if (_pos isEqualType objNull) then {
_pos = getPos _pos;
_pos = getPosATL _pos;
};

private _nearbyVehicles = _pos nearEntities [["Air", "Car", "Motorcycle", "Tank"], _radius]
Expand Down
2 changes: 1 addition & 1 deletion addons/jail/functions/fnc_freeAll.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ GVAR(prisoners) = [];
{
[_x] call FUNC(free);
if (_object isNotEqualTo objNull) then {
_x setPos (getPos _object);
_x setPos (getPosATL _object);
};
} forEach _prisoners;

Expand Down
2 changes: 1 addition & 1 deletion addons/jail/functions/fnc_getRandomJailPos.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
* Public: No
*/

[[[getPos GVAR(jail), GVAR(jail) getVariable "objectArea"]], ["water"]] call BIS_fnc_randomPos;
[[[getPosATL GVAR(jail), GVAR(jail) getVariable "objectArea"]], ["water"]] call BIS_fnc_randomPos;
2 changes: 1 addition & 1 deletion addons/jail/functions/fnc_jailMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

private _markerText = format ["%1", LLSTRING(Jail)];
private _marker = createMarker ["jail", getPos GVAR(jail)];
private _marker = createMarker ["jail", getPosATL GVAR(jail)];
_marker setMarkerType "mil_end";
_marker setMarkerColor "ColorEAST";
_marker setMarkerText _markerText;
Expand Down
4 changes: 2 additions & 2 deletions addons/killers/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if (hasInterface) then {
[QGVAR(teleportedToStart), {
params ["_flag"];
private _actionID = player addAction ["Teleport back", {
player setPos getPos (_this select 3)
player setPos getPosATL (_this select 3)
}, _flag, 10, true];
// Wait until player teleports back or times out
[{player distance (_this select 0) < 10}, {
Expand All @@ -94,7 +94,7 @@ if (hasInterface) then {
params ["_killer", "_destination"];

if (_destination isEqualType objNull) then {
_destination = getPos _destination;
_destination = getPosATL _destination;
};

// Mark nearest vehicles for first couple minutes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* None
*
* Example:
* [getPos bob, 500] call afsk_killers_fnc_createMarkersForNearbyVehicles
* [getPosATL bob, 500] call afsk_killers_fnc_createMarkersForNearbyVehicles
*
* Public: No
*/
Expand All @@ -26,7 +26,7 @@ private _emptyVehicles = _nearbyVehicles select {

{
private _vehicle = _x;
private _marker = createMarkerLocal [format ["vehicle_%1", _vehicle], getPos _vehicle];
private _marker = createMarkerLocal [format ["vehicle_%1", _vehicle], getPosATL _vehicle];
_marker setMarkerColorLocal "ColorCIVILIAN";
_marker setMarkerTextLocal getText (configFile >> "CfgVehicles" >> (typeof _vehicle) >> "displayName");

Expand Down
2 changes: 1 addition & 1 deletion addons/killers/functions/fnc_createStashesMarkers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

{
private _marker = createMarkerlocal [str _x, getPos _x];
private _marker = createMarkerlocal [str _x, getPosATL _x];
_marker setMarkerColorlocal "ColorEAST";
_marker setMarkerSizelocal [0.5,0.5];
_marker setMarkerTypelocal "mil_pickup";
Expand Down
4 changes: 2 additions & 2 deletions addons/killers/functions/fnc_initKillersBase.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
private _killersBase = EGVAR(modules,killersBase);

// Create teleporter to all start positions
private _flag = GVAR(flagClassName) createVehicle (getPos _killersBase);
private _flag = GVAR(flagClassName) createVehicle (getPosATL _killersBase);
_flag setVariable ["killersBase", _killersBase, true];
_killersBase setVariable ["Teleporter", _flag, true];
[QGVAR(createTeleport), [_flag]] call CBA_fnc_globalEventJIP;

// Create arsenal
private _box = createVehicle [GVAR(arsenalBoxClassName), (getPos _killersBase), [], 0, "NONE"];
private _box = createVehicle [GVAR(arsenalBoxClassName), (getPosATL _killersBase), [], 0, "NONE"];
clearItemCargoGlobal _box;
clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;
Expand Down
2 changes: 1 addition & 1 deletion addons/killers/functions/fnc_initKillersStashes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private _createStatshesCount = ceil (random [_stashesCount/2, _stashesCount/1.33
// Initialize random stashes up to _createStatshesCount
for "_y" from 0 to (_createStatshesCount - 1) step 1 do {
private _stash = _stashes deleteAt (floor (random (count (_stashes))));
private _stashPos = getPos _stash;
private _stashPos = getPosATL _stash;
private _box = createVehicle [GVAR(stashBoxClassName), _stashPos, [], 0, "CAN_COLLIDE"];
_box setDir getDir _stash;
clearItemCargoGlobal _box;
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_createCivilianMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (_civilian isEqualTo objNull) exitWith {
};

private _marker = format["civilian_%1", _civilian];
createMarkerLocal [_marker, getPos _civilian];
createMarkerLocal [_marker, getPosATL _civilian];
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerSizeLocal [0.5, 0.5];
_marker setMarkerColorLocal "ColorGreen";
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_createCopMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
params ["_cop"];

private _marker = format["cop_%1", name _cop];
createMarkerLocal [_marker, getPos _cop];
createMarkerLocal [_marker, getPosATL _cop];
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerSizeLocal [0.75, 0.75];
_marker setMarkerColorLocal "ColorWEST";
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_createKillerMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
params ["_killer", ["_hidden", false]];

private _marker = format["killer_%1", name _killer];
createMarkerLocal [_marker, getPos _killer];
createMarkerLocal [_marker, getPosATL _killer];
_marker setMarkerTypeLocal "mil_dot";

if (_hidden) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/police/functions/fnc_copKilledMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ params ["_unit", "_time"];

private _markerName = format ["killed_cop_%1_%2", _unit, serverTime];
private _markerText = format ["%1", _time];
private _marker = createMarker [_markerName, getpos _unit];
private _marker = createMarker [_markerName, getPosATL _unit];
_marker setMarkerType "mil_objective";
_marker setMarkerColor "ColorWEST";
_marker setMarkerSize [0.4, 0.4];
Expand Down
2 changes: 1 addition & 1 deletion addons/police/functions/fnc_initPoliceStation.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if !(isServer) exitWith {};

private _baseName = _logic getVariable ["LocationName", str random(999)];
private _hasHelipad = _logic getVariable ["HasHelipad", false];
private _basePos = getPos _logic;
private _basePos = getPosATL _logic;
private _flag = createVehicle [GVAR(FlagClassname), _basePos, [], 0, "NONE"];
_flag setVariable ["policeStation", _logic, true];

Expand Down
4 changes: 2 additions & 2 deletions addons/police/functions/fnc_initSpawner.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
params ["_spawner"];

private _policeBase = _spawner getVariable "policeStation";
private _baseArea = [getPos _policeBase] + (_policeBase getVariable "objectArea");
private _baseArea = [getPosATL _policeBase] + (_policeBase getVariable "objectArea");

// Variable contains vehicle classname -> action id connection
_spawner setVariable [QGVAR(vehicleActions), true call CBA_fnc_createNamespace, true];
Expand All @@ -29,7 +29,7 @@ private _helipads = (allMissionObjects "Helipad_base_F") inAreaArray _baseArea;

// Preload
{
getPos _x findEmptyPositionReady [0, SPAWNPOINT_SAFEZONE];
getPosATL _x findEmptyPositionReady [0, SPAWNPOINT_SAFEZONE];
} forEach (_spawnPoints + _helipads);

// Assign found spawn points for easier access
Expand Down
2 changes: 1 addition & 1 deletion addons/police/functions/fnc_policeStationMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* 0: Police station marker <STRING>
*
* Example:
* ["Player", getPos player] call afsk_police_fnc_policeStationMarker
* ["Player", getPosATL player] call afsk_police_fnc_policeStationMarker
*
* Public: No
*/
Expand Down
8 changes: 4 additions & 4 deletions addons/police/functions/fnc_spawnVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ private _spawnPoints = if (_vehicleType isEqualTo "Helicopter" || {_vehicleType
private _position = [];
private _direction = 0;

private _emptySpawnPointIndex = _spawnPoints findIf {getPos _x nearEntities SPAWNPOINT_SAFEZONE isEqualTo []};
private _emptySpawnPointIndex = _spawnPoints findIf {getPosATL _x nearEntities SPAWNPOINT_SAFEZONE isEqualTo []};
if (_emptySpawnPointIndex isNotEqualTo -1) then {
LOG("Found empty spawnpoint");
private _spawnPoint = _spawnPoints select _emptySpawnPointIndex;
_position = getPos _spawnPoint;
_position = getPosATL _spawnPoint;
_direction = getDir _spawnPoint;
} else {
// Maybe there is a position that has unoccupied vehicle
LOG("Looking for unoccupied vehicles");
private _fullSpawnPointsWithoutCrew = _spawnPoints select {
private _nearEntities = getPos _x nearEntities SPAWNPOINT_SAFEZONE;
private _nearEntities = getPosATL _x nearEntities SPAWNPOINT_SAFEZONE;
if (_nearEntities isEqualTo []) exitWith { false };
_nearEntities findIf {crew _x isEqualTo []} isNotEqualTo -1
};
Expand All @@ -58,7 +58,7 @@ if (_emptySpawnPointIndex isNotEqualTo -1) then {
deleteVehicle _x;
};

_position = getPos _spawnPoint;
_position = getPosATL _spawnPoint;
_direction = getDir _spawnPoint;
};
};
Expand Down
2 changes: 1 addition & 1 deletion addons/vehicles/functions/fnc_createVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (_vehicleClassname isEqualType configNull) then {
};

if (_position isEqualType objNull) then {
_position = getPos _position;
_position = getPosATL _position;
};

private _mode = if (_forcePosition) then {"CAN_COLLIDE"} else {"NONE"};
Expand Down

0 comments on commit eb4f0fb

Please sign in to comment.