fnc_moduleOrbitalDroidDispenser.sqf 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "function_macros.hpp"
  2. LOG("Spawned Orbital Drop Droid Dispenser Logic");
  3. params["_logic", "_units", "_activated"];
  4. if (isServer) then
  5. {
  6. LOG("Server, continuing on");
  7. _position = position _logic;
  8. LOGF_1("Firing Droid Dispenser Artillery at '%1'", _position);
  9. if (_activated) then {
  10. // fire projectile
  11. LOG("Activated");
  12. private _fnc_ThenDo = {
  13. params["_position"];
  14. if(!isServer) exitWith
  15. {
  16. LOG("Exiting Client Method Should only run on Server");
  17. };
  18. LOG("Server, continuing on");
  19. _spawner = GVAR(spawnerDefaultObject) createVehicle _position;
  20. LOGF_2("Created Droid Dispenser Object '%1' at '%2'", _spawner, _position);
  21. [{
  22. params["_unit"];
  23. LOG("Adding to curators");
  24. if(!isServer) exitWith
  25. {
  26. LOG("Exiting Client Method Should only run on Server");
  27. };
  28. [_unit] call FUNC(droidDispenserInit);
  29. {
  30. _x addCuratorEditableObjects [[_unit], true];
  31. } forEach allCurators;
  32. }, [_spawner]] call CBA_fnc_execNextFrame;
  33. };
  34. [_fnc_ThenDo, [+_position], GVAR(fireSupportSpawnDelay)] call CBA_fnc_waitAndExecute;
  35. };
  36. };
  37. LOG("Placing Projectile Module");
  38. _this call ace_zeus_fnc_bi_moduleProjectile;