MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / play_cycle

Method play_cycle

ogsr_engine/xrGame/script_game_object2.cpp:124–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124u32 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
147u32 CScriptGameObject::play_cycle(LPCSTR anim) const { return play_cycle(anim, true); }
148

Callers

nothing calls this directly

Calls 6

play_cycleFunction · 0.85
VisualMethod · 0.80
ID_CycleMethod · 0.80
PlayCycleMethod · 0.80
script_logMethod · 0.80
objectFunction · 0.50

Tested by

no test coverage detected