mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 10:37:41 -04:00
Fix bug for python SDL variable-length arrays
This commit is contained in:
@ -474,6 +474,12 @@ void plPythonSDLModifier::IPythonVarToSDL(plStateDataRecord* state, const char*
|
||||
int count = PyTuple_Size(pyVar);
|
||||
plSimpleVarDescriptor::Type type = var->GetSimpleVarDescriptor()->GetType();
|
||||
|
||||
// Ensure that variable length arrays match.
|
||||
if (var->GetSimpleVarDescriptor()->IsVariableLength()) {
|
||||
if (var->GetCount() != count)
|
||||
var->Alloc(count);
|
||||
}
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
PyObject* pyVarItem = PyTuple_GetItem(pyVar, i);
|
||||
|
Reference in New Issue
Block a user