Skip to content

Commit

Permalink
move to use table
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf109909 committed Nov 7, 2023
1 parent 2913f01 commit f566f46
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions NorthstarDLL/scripts/scriptsvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@ SQRESULT NSSvmTrain(HSquirrelVM* sqvm)
{
//g_pSquirrel<ScriptContext::SERVER>->__sq_get
SQArray* array = sqvm->_stackOfCurrentFunction[1]._VAL.asArray;
std::vector<Vector3> origins;
std::vector<std::pair<Vector3,int>> origins;

for (int vIdx = 0; vIdx < array->_usedSlots; ++vIdx)


SQTable* originsTable = sqvm->_stackOfCurrentFunction[1]._VAL.asTable;
for (int idx = 0; idx < originsTable->_numOfNodes; ++idx)
{
if (array->_values[vIdx]._Type == OT_STRING)
tableNode* node = &originsTable->_nodes[idx];

if (node->key._Type == OT_VECTOR && node->val._Type == OT_INTEGER)
{
origins.push_back(Vector3(
array->_values[vIdx]._VAL.asVector->x, array->_values[vIdx]._VAL.asVector->y, array->_values[vIdx]._VAL.asVector->z));
origins.push_back(
std::make_pair(Vector3(node->key._VAL.asVector->x, node->key._VAL.asVector->y,node->key._VAL.asVector->z),node->val._VAL.as64Integer));
}
}


// origins operations


Expand Down

0 comments on commit f566f46

Please sign in to comment.