diff --git a/addons/statemachine/fnc_addState.sqf b/addons/statemachine/fnc_addState.sqf index a5d588cdb..1311d78e8 100644 --- a/addons/statemachine/fnc_addState.sqf +++ b/addons/statemachine/fnc_addState.sqf @@ -58,12 +58,9 @@ _stateMachine setVariable [ONSTATEENTERED(_name), _onStateEntered]; _stateMachine setVariable [ONSTATELEAVING(_name), _onStateLeaving]; _stateMachine setVariable [TRANSITIONS(_name), []]; -diag_log "derp"; - // First state added is always the intial state if (isNil {_stateMachine getVariable QGVAR(initialState)}) then { _stateMachine setVariable [QGVAR(initialState), _name]; - diag_log "initial state set"; }; _name diff --git a/addons/statemachine/fnc_create.sqf b/addons/statemachine/fnc_create.sqf index 6e4c6349b..f3e2f6fb9 100644 --- a/addons/statemachine/fnc_create.sqf +++ b/addons/statemachine/fnc_create.sqf @@ -32,7 +32,7 @@ if (isNil QGVAR(stateMachines)) then { }; private _updateCode = {}; -if (typeName _list == "CODE") then { +if (_list isEqualType {}) then { _updateCode = _list; _list = [] call _updateCode; }; diff --git a/addons/statemachine/fnc_createFromConfig.sqf b/addons/statemachine/fnc_createFromConfig.sqf index 8d355e94a..80b5bebfd 100644 --- a/addons/statemachine/fnc_createFromConfig.sqf +++ b/addons/statemachine/fnc_createFromConfig.sqf @@ -37,7 +37,7 @@ private _stateMachine = [_list] call FUNC(create); [_stateMachine, _onState, _onStateEntered, _onStateLeaving, _state] call FUNC(addState); false -} count ("true" configClasses _config); +} count (configProperties [_config, "isClass _x", true]); // We need to add the transitions in a second loop to make sure the states exist already { @@ -51,9 +51,9 @@ private _stateMachine = [_list] call FUNC(create); [_stateMachine, _state, _targetState, _condition, _onTransition, _transition] call FUNC(addTransition); false - } count ("true" configClasses _x); + } count (configProperties [_x, "isClass _x", true]); false -} count ("true" configClasses _config); +} count (configProperties [_config, "isClass _x", true]); _stateMachine diff --git a/addons/statemachine/fnc_delete.sqf b/addons/statemachine/fnc_delete.sqf index ae11434b1..03a007df3 100644 --- a/addons/statemachine/fnc_delete.sqf +++ b/addons/statemachine/fnc_delete.sqf @@ -27,5 +27,5 @@ if (isNil QGVAR(stateMachines)) exitWith {}; private _index = GVAR(stateMachines) find _stateMachine; if (_index != -1) then { GVAR(stateMachines) deleteAt _index; - deleteLocation _stateMachine; + [_stateMachine] call CBA_fnc_deleteNamespace; };