Cleanup unused and undefinend functions
I wrote a little script that crawls all SQF, HPP and CPP files for unused and undefined functions, similar to search_undefinedFunctions.py but without the use of SQF. Public functions are already filtered as well. This is its current output:
Undefined functions:
- [ ]
ace_common_fnc_localanim - [ ]
ace_missileguidance_fnc_checkseekerlos - [x]
ace_refuel_fnc_canattach
Unused functions:
- [ ]
ace_captives_fnc_canfriskperson - [ ]
ace_captives_fnc_dofriskperson - [ ]
ace_captives_fnc_handleonunconscious - [ ]
ace_cargo_fnc_canload - [x]
ace_common_fnc_addactionmenueventhandler - [x]
ace_common_fnc_addcuratorunloadeventhandler - [ ]
ace_common_fnc_addsetting - [ ]
ace_common_fnc_debugmodule - [ ]
ace_common_fnc_dumpperformancecounters - [x]
ace_common_fnc_execpersistentfnc - [x]
ace_common_fnc_exportconfig - [ ]
ace_common_fnc_getdefinedvariable - [ ]
ace_common_fnc_getnumbermagazinesin - [x]
ace_common_fnc_getselectionswithouthitpoints - [x]
ace_common_fnc_getstaminabarcontrol - [ ]
ace_common_fnc_modulelsdvehicles - [x]
ace_common_fnc_owned - [x]
ace_common_fnc_removeactionmenueventhandler - [x]
ace_common_fnc_removecaninteractwithcondition - [ ]
ace_common_fnc_removesyncedeventhandler - [ ]
ace_common_fnc_requestsyncedevent - [ ]
ace_common_fnc_showuser - [ ]
ace_common_fnc_throttledpublicvariable - [ ]
ace_common_fnc_translatetomodelspace - [ ]
ace_common_fnc_translatetoweaponspace - [ ]
ace_common_fnc_waveheightat - [ ]
ace_fcs_fnc_getangle - [ ]
ace_fcs_fnc_updaterangehud - [ ]
ace_frag_fnc_addblacklist - [ ]
ace_frag_fnc_removepfhround - [ ]
ace_frag_fnc_removetrack - [ ]
ace_frag_fnc_stoptracing - [x]
ace_interact_menu_fnc_removeactionfromclass - [x]
ace_interact_menu_fnc_removeactionfromobject - [ ]
ace_interaction_fnc_moduleinteraction - [x]
ace_interaction_fnc_removetag - [ ]
ace_laser_fnc_checklos - [ ]
ace_laser_fnc_drawvisiblelasertargets - [ ]
ace_laser_fnc_findstrongestray - [ ]
ace_laser_selfdesignate_fnc_getposasl - [ ]
ace_maptools_fnc_handlemousezchanged - [ ]
ace_medical_fnc_addunloadpatientactions - [ ]
ace_medical_fnc_copydeadbody - [ ]
ace_medical_fnc_handlecollisiondamage - [ ]
ace_medical_fnc_handledamage_airway - [ ]
ace_medical_fnc_handledamage_fractures - [ ]
ace_medical_fnc_handledamage_internalinjuries - [ ]
ace_missileguidance_fnc_attackprofile_air - [ ]
ace_missileguidance_fnc_dohandoff - [ ]
ace_missileguidance_fnc_rotatevectline - [ ]
ace_missileguidance_fnc_rotatevectlinegetmap - [ ]
ace_mk6mortar_fnc_dev_buildtable - [x]
ace_refuel_fnc_makejerrycan - [x]
ace_refuel_fnc_reset - [x]
ace_respawn_fnc_removebody
Undefined functions:
ace_common_fnc_localanim
ace_missileguidance_fnc_checkseekerlos
ace_refuel_fnc_canattach
Unused functions:
ace_captives_fnc_canfriskperson
ace_captives_fnc_dofriskperson
ace_captives_fnc_handleonunconscious
ace_cargo_fnc_canload
ace_common_fnc_addactionmenueventhandler
ace_common_fnc_addcuratorunloadeventhandler
ace_common_fnc_addsetting
ace_common_fnc_debugmodule
ace_common_fnc_dumpperformancecounters
ace_common_fnc_execpersistentfnc
ace_common_fnc_exportconfig
ace_common_fnc_getdefinedvariable
ace_common_fnc_getnumbermagazinesin
ace_common_fnc_getselectionswithouthitpoints
ace_common_fnc_getstaminabarcontrol
ace_common_fnc_modulelsdvehicles
ace_common_fnc_owned
ace_common_fnc_removeactionmenueventhandler
ace_common_fnc_removecaninteractwithcondition
ace_common_fnc_removesyncedeventhandler
ace_common_fnc_requestsyncedevent
ace_common_fnc_showuser
ace_common_fnc_throttledpublicvariable
ace_common_fnc_translatetomodelspace
ace_common_fnc_translatetoweaponspace
ace_common_fnc_waveheightat
ace_fcs_fnc_getangle
ace_fcs_fnc_updaterangehud
ace_frag_fnc_addblacklist
ace_frag_fnc_removepfhround
ace_frag_fnc_removetrack
ace_frag_fnc_stoptracing
ace_interact_menu_fnc_removeactionfromclass
ace_interact_menu_fnc_removeactionfromobject
ace_interaction_fnc_moduleinteraction
ace_interaction_fnc_removetag
ace_laser_fnc_checklos
ace_laser_fnc_drawvisiblelasertargets
ace_laser_fnc_findstrongestray
ace_laser_selfdesignate_fnc_getposasl
ace_maptools_fnc_handlemousezchanged
ace_medical_fnc_addunloadpatientactions
ace_medical_fnc_copydeadbody
ace_medical_fnc_handlecollisiondamage
ace_medical_fnc_handledamage_airway
ace_medical_fnc_handledamage_fractures
ace_medical_fnc_handledamage_internalinjuries
ace_missileguidance_fnc_attackprofile_air
ace_missileguidance_fnc_dohandoff
ace_missileguidance_fnc_rotatevectline
ace_missileguidance_fnc_rotatevectlinegetmap
ace_mk6mortar_fnc_dev_buildtable
ace_refuel_fnc_makejerrycan
ace_refuel_fnc_reset
ace_respawn_fnc_removebody
A bunch of these can be removed, others should probably be changed to public. I can add the script to the tools if so desired, could be useful.
I like that this ticket is 3k 404 :kappa:
can be removed immediately, remnant from agm:
ace_interaction_fnc_removetag
can be removed immediately, replaced with BI body manager:
ace_respawn_fnc_removebody
can be removed immediately, replaced with allinone configs (much more powerful):
ace_common_fnc_exportconfig
already deprecated, will be removed with execremotefnc:
ace_common_fnc_execpersistentfnc
~~Deprectae, replaced with getAllHitPointsSelection:~~
NVM, this is still usefull and already rewritten
ace_common_fnc_getselectionswithouthitpoints
Debug / still needed / API:
ace_common_fnc_getstaminabarcontrol
ace_common_fnc_owned
ace_common_fnc_removecaninteractwithcondition
Cool ideas - never used:
ace_common_fnc_addactionmenueventhandler
ace_common_fnc_removeactionmenueventhandler
I've updated the OP to a task list.
addCuratorUnloadEventhandler never being used also causes FUNC(fixCrateContent) to never be used. I'll check if BI fixed the bug.
Apparently I fixed this over a year ago by setting the type to 4096 instead of 4. Now the BI mine detector is the only buged item in zeus. Good job me. https://github.com/acemod/ACE3/blob/master/addons/common/CfgWeapons.hpp#L5
ace_interact_menu_fnc_removeactionfromclass ace_interact_menu_fnc_removeactionfromobject are API
Done with everything I know.
ace_common_fnc_dumpperformancecounters is very usefull debug tool.
ace_refuel_fnc_makejerrycan and ace_refuel_fnc_reset are there for a purpose/API. DO NOT DELETE!
ace_refuel_fnc_canattach is not defined - you can remove the entire part where it is called || {!([_target, _unit, _itemClassname] call FUNC(canAttach))}.
ace_refuel_fnc_makejerrycan and ace_refuel_fnc_reset
If they are API they need to be marked as public: Yes
@BaerMitUmlaut ace_refuel has been cleaned in #3411
Closing due to age, inactivity or already solved. May be re-opened if the issue is still present, even better just open a new up-to-date Issue.