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

Method CheckInfo

ogsr_engine/xrGame/PhraseScript.cpp:43–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43bool CPhraseScript::CheckInfo(const CInventoryOwner* pOwner) const
44{
45 THROW(pOwner);
46
47 for (u32 i = 0; i < m_HasInfo.size(); i++)
48 {
49#pragma todo("Andy->Andy how to check infoportion existence in XML ?")
50 /* INFO_INDEX result = CInfoPortion::IdToIndex(m_HasInfo[i],NO_INFO_INDEX,true);
51 if (result == NO_INFO_INDEX) {
52 ai().script_engine().script_log(eLuaMessageTypeError,"XML item not found : \"%s\"",*m_HasInfo[i]);
53 break;
54 }
55 */
56 //. if (!pOwner->HasInfo(m_HasInfo[i])) {
57 if (!Actor()->HasInfo(m_HasInfo[i]))
58 {
59#ifdef DEBUG
60 if (psAI_Flags.test(aiDialogs))
61 Msg("----rejected: [%s] has info %s", pOwner->Name(), *m_HasInfo[i]);
62#endif
63 return false;
64 }
65 }
66
67 for (u32 i = 0; i < m_DontHasInfo.size(); i++)
68 {
69 /* INFO_INDEX result = CInfoPortion::IdToIndex(m_DontHasInfo[i],NO_INFO_INDEX,true);
70 if (result == NO_INFO_INDEX) {
71 ai().script_engine().script_log(eLuaMessageTypeError,"XML item not found : \"%s\"",*m_DontHasInfo[i]);
72 break;
73 }
74 */
75 //. if (pOwner->HasInfo(m_DontHasInfo[i])) {
76 if (Actor()->HasInfo(m_DontHasInfo[i]))
77 {
78#ifdef DEBUG
79 if (psAI_Flags.test(aiDialogs))
80 Msg("----rejected: [%s] dont has info %s", pOwner->Name(), *m_DontHasInfo[i]);
81#endif
82 return false;
83 }
84 }
85 return true;
86}
87
88void CPhraseScript::TransferInfo(const CInventoryOwner* pOwner) const
89{

Callers

nothing calls this directly

Calls 6

ActorFunction · 0.85
MsgFunction · 0.85
sizeMethod · 0.45
HasInfoMethod · 0.45
testMethod · 0.45
NameMethod · 0.45

Tested by

no test coverage detected