mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-29 06:07:57 +03:00
Fixed crash when loading savegame
This commit is contained in:
parent
ce1b3aaee9
commit
467802c466
2 changed files with 5 additions and 14 deletions
|
@ -659,13 +659,8 @@ void GameScript::ArchiveCodePos( Archiver& arc, unsigned char **codePos )
|
|||
int pos = 0;
|
||||
str filename;
|
||||
|
||||
if( !arc.Saving() )
|
||||
{
|
||||
pos = *codePos - m_ProgBuffer;
|
||||
if( pos >= 0 && pos < m_ProgLength )
|
||||
{
|
||||
filename = Filename();
|
||||
}
|
||||
if( arc.Saving() ) {
|
||||
GetCodePos(*codePos, filename, pos);
|
||||
}
|
||||
|
||||
arc.ArchiveInteger( &pos );
|
||||
|
@ -673,10 +668,7 @@ void GameScript::ArchiveCodePos( Archiver& arc, unsigned char **codePos )
|
|||
|
||||
if( arc.Loading() )
|
||||
{
|
||||
if( Filename() == filename )
|
||||
{
|
||||
*codePos = m_ProgBuffer + pos;
|
||||
}
|
||||
SetCodePos(*codePos, filename, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue