| 122 | } |
| 123 | |
| 124 | u32 CScriptGameObject::play_cycle(LPCSTR anim, bool mix_in) const |
| 125 | { |
| 126 | if (auto sa = smart_cast<IKinematicsAnimated*>(object().Visual())) |
| 127 | { |
| 128 | MotionID m = sa->ID_Cycle(anim); |
| 129 | if (m) |
| 130 | { |
| 131 | CBlend* blend = sa->PlayCycle(m, (BOOL)mix_in); |
| 132 | return blend ? blend->timeTotal : 0; |
| 133 | } |
| 134 | else |
| 135 | { |
| 136 | ai().script_engine().script_log(ScriptStorage::eLuaMessageTypeError, "CGameObject : has not cycle %s", anim); |
| 137 | } |
| 138 | } |
| 139 | else |
| 140 | { |
| 141 | ai().script_engine().script_log(ScriptStorage::eLuaMessageTypeError, "CGameObject : is not animated object"); |
| 142 | } |
| 143 | |
| 144 | return 0; |
| 145 | } |
| 146 | |
| 147 | u32 CScriptGameObject::play_cycle(LPCSTR anim) const { return play_cycle(anim, true); } |
| 148 |
nothing calls this directly
no test coverage detected