mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Implemented MakePrimitive()
This commit is contained in:
parent
77ef0f3579
commit
960469be77
2 changed files with 33 additions and 6 deletions
|
@ -281,6 +281,19 @@ void ScriptVariable::ArchiveInternal(Archiver& arc)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptVariable::MakePrimitive()
|
||||
{
|
||||
switch (type) {
|
||||
case VARIABLE_LISTENER:
|
||||
case VARIABLE_REF:
|
||||
case VARIABLE_CONTAINER:
|
||||
case VARIABLE_SAFECONTAINER:
|
||||
Com_Error(ERR_DROP, "^~^~^ game.%s cannot be archived since it is of type '%s'.", getName().c_str(), GetTypeName());
|
||||
Clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
ScriptArrayHolder::ScriptArrayHolder()
|
||||
|
@ -2568,6 +2581,15 @@ void ScriptVariableList::Archive(Archiver& arc)
|
|||
list.Archive(arc);
|
||||
}
|
||||
|
||||
void ScriptVariableList::MakePrimitive()
|
||||
{
|
||||
con_set_enum<short3, ScriptVariable> en = list;
|
||||
|
||||
for (con_set_enum<short3, ScriptVariable>::Entry *entry = en.NextElement(); entry; entry = en.NextElement()) {
|
||||
entry->value.MakePrimitive();
|
||||
}
|
||||
}
|
||||
|
||||
CLASS_DECLARATION(Class, ScriptVariableList, NULL) {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue