mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +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}
|
||||
};
|
||||
|
|
|
@ -111,10 +111,6 @@ public:
|
|||
|
||||
~ScriptVariable();
|
||||
|
||||
void Archive(Archiver& arc);
|
||||
static void Archive(Archiver& arc, ScriptVariable **obj);
|
||||
void ArchiveInternal(Archiver& arc);
|
||||
|
||||
void CastBoolean(void);
|
||||
void CastConstArrayValue(void);
|
||||
void CastEntity(void);
|
||||
|
@ -235,6 +231,12 @@ public:
|
|||
|
||||
ScriptVariable operator++(int);
|
||||
ScriptVariable operator--(int);
|
||||
|
||||
void Archive(Archiver& arc);
|
||||
static void Archive(Archiver& arc, ScriptVariable** obj);
|
||||
void ArchiveInternal(Archiver& arc);
|
||||
|
||||
void MakePrimitive();
|
||||
};
|
||||
|
||||
class ScriptArrayHolder : public LightClass
|
||||
|
@ -293,6 +295,8 @@ class con_set_Entry<short3, ScriptVariable>
|
|||
|
||||
private:
|
||||
con_set_Entry *next;
|
||||
|
||||
public:
|
||||
ScriptVariable value;
|
||||
|
||||
public:
|
||||
|
@ -318,8 +322,6 @@ public:
|
|||
|
||||
ScriptVariableList();
|
||||
|
||||
void Archive(Archiver& arc) override;
|
||||
|
||||
void ClearList(void);
|
||||
|
||||
ScriptVariable *GetOrCreateVariable(str name);
|
||||
|
@ -338,6 +340,9 @@ public:
|
|||
ScriptVariable *SetVariable(const char *name, ScriptVariable& value);
|
||||
ScriptVariable *SetVariable(unsigned int name, ScriptVariable& value);
|
||||
ScriptVariable *SetVariable(unsigned int name, ScriptVariable&& value);
|
||||
|
||||
void Archive(Archiver& arc) override;
|
||||
void MakePrimitive();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue