1. Place a unit in the editor and name it test_unit
2. Init.sqf:
_anims = [
"ainvpknlmstpsnonwrfldnon_ainvpknlmstpsnonwrfldnon_medic",
"AinvPknlMstpSnonWrflDnon_medic0s",
"AinvPknlMstpSnonWrflDnon_medic",
"AinvPknlMstpSnonWrflDnon_medic0",
"AinvPknlMstpSnonWrflDnon_medic1",
"AinvPknlMstpSnonWrflDnon_medic2",
"AinvPknlMstpSnonWrflDnon_medic3",
"AinvPknlMstpSnonWrflDnon_medic4",
"AinvPknlMstpSnonWrflDnon_medic5",
"AinvPknlMstpSnonWrflDnon_medicend"
];
sleep 1;
test_unit playActionNow "medicStart";
sleep 1;
_anim = (animationState test_unit);
hint format["%1 (%2)", (_anim in _anims), _anim];
diag_log text format["%1 (%2)", (_anim in _anims), _anim];
while {(_anim in _anims)} do {
_anim = (animationState test_unit);
hint format["%1 (%2)", (_anim in _anims), _anim];
diag_log text format["%1 (%2)", (_anim in _anims), _anim];
sleep 1;
};
3. Result will be:
true (ainvpknlmstpsnonwrfldnon_ainvpknlmstpsnonwrfldnon_medic)
true (ainvpknlmstpsnonwrfldnon_ainvpknlmstpsnonwrfldnon_medic)
false (ainvpknlmstpsnonwrfldnon_medic0s) <-- FALSE - EVEN THOUGH THIS IS INSIDE THE _anims ARRAY
Same is true for direct comparison like:
if ((animationState test_unit) != "ainvpknlmstpsnonwrfldnon_ainvpknlmstpsnonwrfldnon_medic"
&&
(animationState test_unit) != "AinvPknlMstpSnonWrflDnon_medic0s"
&&
(animationState test_unit) != "AinvPknlMstpSnonWrflDnon_medic"
&&
(animationState test_unit) != "AinvPknlMstpSnonWrflDnon_medic0"
&&
(animationState test_unit) != "AinvPknlMstpSnonWrflDnon_medic1"
&&
(animationState test_unit) != "AinvPknlMstpSnonWrflDnon_medic2"
&&
(animationState test_unit) != "AinvPknlMstpSnonWrflDnon_medic3"
&&
(animationState test_unit) != "AinvPknlMstpSnonWrflDnon_medic4"
&&
(animationState test_unit) != "AinvPknlMstpSnonWrflDnon_medic4"
&&
(animationState test_unit) != "AinvPknlMstpSnonWrflDnon_medicend") then {};
Condition will be FALSE although is should/must be TRUE.
WTF.