mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 23:12:24 +00:00
Merge branch 'ACS_check' of https://github.com/Edward850/zdoom
This commit is contained in:
commit
7f8c0b4f64
2 changed files with 9 additions and 0 deletions
|
@ -1581,20 +1581,28 @@ void FBehavior::StaticSerializeModuleStates (FArchive &arc)
|
||||||
for (modnum = 0; modnum < StaticModules.Size(); ++modnum)
|
for (modnum = 0; modnum < StaticModules.Size(); ++modnum)
|
||||||
{
|
{
|
||||||
FBehavior *module = StaticModules[modnum];
|
FBehavior *module = StaticModules[modnum];
|
||||||
|
int ModSize = module->GetDataSize();
|
||||||
|
|
||||||
if (arc.IsStoring())
|
if (arc.IsStoring())
|
||||||
{
|
{
|
||||||
arc.WriteString (module->ModuleName);
|
arc.WriteString (module->ModuleName);
|
||||||
|
if (SaveVersion >= 4516) arc << ModSize;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *modname = NULL;
|
char *modname = NULL;
|
||||||
arc << modname;
|
arc << modname;
|
||||||
|
if (SaveVersion >= 4516) arc << ModSize;
|
||||||
if (stricmp (modname, module->ModuleName) != 0)
|
if (stricmp (modname, module->ModuleName) != 0)
|
||||||
{
|
{
|
||||||
delete[] modname;
|
delete[] modname;
|
||||||
I_Error ("Level was saved with a different set of ACS modules.");
|
I_Error ("Level was saved with a different set of ACS modules.");
|
||||||
}
|
}
|
||||||
|
else if (ModSize != module->GetDataSize())
|
||||||
|
{
|
||||||
|
delete[] modname;
|
||||||
|
I_Error("ACS module %s has changed from what was saved. (Have %d bytes, save has %d bytes)", module->ModuleName, module->GetDataSize(), ModSize);
|
||||||
|
}
|
||||||
delete[] modname;
|
delete[] modname;
|
||||||
}
|
}
|
||||||
module->SerializeVars (arc);
|
module->SerializeVars (arc);
|
||||||
|
|
|
@ -308,6 +308,7 @@ public:
|
||||||
int GetScriptIndex (const ScriptPtr *ptr) const { ptrdiff_t index = ptr - Scripts; return index >= NumScripts ? -1 : (int)index; }
|
int GetScriptIndex (const ScriptPtr *ptr) const { ptrdiff_t index = ptr - Scripts; return index >= NumScripts ? -1 : (int)index; }
|
||||||
ScriptPtr *GetScriptPtr(int index) const { return index >= 0 && index < NumScripts ? &Scripts[index] : NULL; }
|
ScriptPtr *GetScriptPtr(int index) const { return index >= 0 && index < NumScripts ? &Scripts[index] : NULL; }
|
||||||
int GetLumpNum() const { return LumpNum; }
|
int GetLumpNum() const { return LumpNum; }
|
||||||
|
int GetDataSize() const { return DataSize; }
|
||||||
const char *GetModuleName() const { return ModuleName; }
|
const char *GetModuleName() const { return ModuleName; }
|
||||||
ACSProfileInfo *GetFunctionProfileData(int index) { return index >= 0 && index < NumFunctions ? &FunctionProfileData[index] : NULL; }
|
ACSProfileInfo *GetFunctionProfileData(int index) { return index >= 0 && index < NumFunctions ? &FunctionProfileData[index] : NULL; }
|
||||||
ACSProfileInfo *GetFunctionProfileData(ScriptFunction *func) { return GetFunctionProfileData((int)(func - (ScriptFunction *)Functions)); }
|
ACSProfileInfo *GetFunctionProfileData(ScriptFunction *func) { return GetFunctionProfileData((int)(func - (ScriptFunction *)Functions)); }
|
||||||
|
|
Loading…
Reference in a new issue