MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / GetObjectStatus

Method GetObjectStatus

CrySystem/ScriptObjectEntity.cpp:2084–2120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2082}
2083
2084int CScriptObjectEntity::GetObjectStatus(IFunctionHandler *pH)
2085{
2086 // Given the slot number this routine returns a table containing all
2087 // useful information about a script object
2088
2089 CHECK_PARAMETERS(1);
2090 _SmartScriptObject pTable(m_pScriptSystem);
2091 CScriptObjectVector oVecPos(m_pScriptSystem);
2092 CScriptObjectVector oVecAngles(m_pScriptSystem);
2093 CScriptObjectVector oVecScale(m_pScriptSystem);
2094 CScriptObjectVector oVecOffset(m_pScriptSystem);
2095
2096 int nSlot;
2097 CEntityObject theEntityObject;
2098
2099 pH->GetParam(1,nSlot);
2100
2101 if (m_pEntity && m_pEntity->GetEntityObject(nSlot, theEntityObject))
2102 {
2103 oVecPos = theEntityObject.pos;
2104 oVecAngles = theEntityObject.angles;
2105 oVecScale = theEntityObject.scale;
2106
2107 // Calculate the mispoint of the bounding box
2108 oVecOffset = (theEntityObject.object->GetBoxMax() + theEntityObject.object->GetBoxMin()) / 2.0;
2109
2110 pTable->SetValue("flags", theEntityObject.flags);
2111 pTable->SetValue("pos", *oVecPos);
2112 pTable->SetValue("angles", *oVecAngles);
2113 pTable->SetValue("scale", *oVecScale);
2114 pTable->SetValue("offset", *oVecOffset);
2115
2116 return pH->EndFunction(*pTable);
2117 }
2118
2119 return pH->EndFunctionNull();
2120}
2121
2122int CScriptObjectEntity::SetObjectStatus(IFunctionHandler *pH)
2123{

Callers

nothing calls this directly

Calls 7

GetEntityObjectMethod · 0.80
GetBoxMaxMethod · 0.80
GetBoxMinMethod · 0.80
EndFunctionMethod · 0.80
EndFunctionNullMethod · 0.80
GetParamMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected