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

Function storyId2GameId

ogsr_engine/xrGame/GameTask.cpp:36–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36u16 storyId2GameId(ALife::_STORY_ID id)
37{
38 if (ai().get_alife())
39 {
40 CSE_ALifeDynamicObject* so = ai().alife().story_objects().object(id, true);
41 return (so) ? so->ID : u16(-1);
42 }
43 else
44 {
45 u32 cnt = Level().Objects.o_count();
46 for (u32 it = 0; it < cnt; ++it)
47 {
48 CObject* O = Level().Objects.o_get_by_iterator(it);
49 CGameObject* GO = smart_cast<CGameObject*>(O);
50 if (GO->story_id() == id)
51 return GO->ID();
52 }
53 return u16(-1);
54 }
55}
56
57CUIXml* g_gameTaskXml = NULL;
58

Callers 1

LoadMethod · 0.85

Calls 2

get_alifeMethod · 0.80
objectMethod · 0.45

Tested by

no test coverage detected