| 2082 | } |
| 2083 | |
| 2084 | int 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 | |
| 2122 | int CScriptObjectEntity::SetObjectStatus(IFunctionHandler *pH) |
| 2123 | { |
nothing calls this directly
no test coverage detected