mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
clarified function description and removed unneeded comments
This commit is contained in:
parent
73d0064607
commit
a1c498d338
@ -1,12 +1,16 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Lambda.Tiger
|
* Author: Lambda.Tiger
|
||||||
* This function adds a round to be traced.
|
* This function initialize projectile tracking of a round so that it's path
|
||||||
|
* can be drawn in debug mode. It may optionally include hit / explode /
|
||||||
|
* deflected event handlers that spawn color coded spheres on each event,
|
||||||
|
* green / red / blue, respectively.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Projectile <OBJECT>
|
* 0: Projectile to be tracked. <OBJECT>
|
||||||
* 1: Add projectile event handlers <BOOL>
|
* 1: Add projectile hit/explode/defelceted event handlers. <BOOL>
|
||||||
* 2: Is the round blue <BOOL>
|
* 2: Is the round fired by a unit on the same side as the player
|
||||||
|
* true results in blue traces, false in red. <BOOL>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -16,19 +20,19 @@
|
|||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params [
|
params [
|
||||||
"_projectile",
|
"_projectile",
|
||||||
["_addProjectileEventHandlers", true, [true]],
|
["_addProjectileEventHandlers", true, [true]],
|
||||||
["_isSidePlayer", true, [true]]
|
["_isSidePlayer", true, [true]]
|
||||||
];
|
];
|
||||||
|
|
||||||
// track round on each frame
|
|
||||||
// Create entry in position array from hashmap
|
|
||||||
if (_isSidePlayer) then {
|
if (_isSidePlayer) then {
|
||||||
GVAR(dev_trackLines) set [getObjectID _projectile, [[getposATL _projectile], [0, 0, 1, 1]]];
|
GVAR(dev_trackLines) set [getObjectID _projectile, [[getposATL _projectile], [0, 0, 1, 1]]];
|
||||||
} else {
|
} else {
|
||||||
GVAR(dev_trackLines) set [getObjectID _projectile, [[getposATL _projectile], [1, 0, 0, 1]]];
|
GVAR(dev_trackLines) set [getObjectID _projectile, [[getposATL _projectile], [1, 0, 0, 1]]];
|
||||||
};
|
};
|
||||||
|
|
||||||
// event handler to track round and cleanup when round is "dead"
|
// event handler to track round and cleanup when round is "dead"
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@ -48,7 +52,6 @@ if (_isSidePlayer) then {
|
|||||||
|
|
||||||
if (!_addProjectileEventHandlers) exitWith {};
|
if (!_addProjectileEventHandlers) exitWith {};
|
||||||
|
|
||||||
// Add hitPart eventHandler
|
|
||||||
_projectile addEventHandler [
|
_projectile addEventHandler [
|
||||||
"HitPart",
|
"HitPart",
|
||||||
{
|
{
|
||||||
@ -61,7 +64,6 @@ _projectile addEventHandler [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
// Add explode event handler
|
|
||||||
_projectile addEventHandler [
|
_projectile addEventHandler [
|
||||||
"Explode",
|
"Explode",
|
||||||
{
|
{
|
||||||
@ -74,7 +76,6 @@ _projectile addEventHandler [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
// Add deflected eventHandler
|
|
||||||
_projectile addEventHandler [
|
_projectile addEventHandler [
|
||||||
"Deflected",
|
"Deflected",
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user