-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reverted Worldmap.cpp changes in commit c19137b
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32924db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sfalldb.sav was added in 4.1.1 for get/set_can_rest_on_map functions, at first it has a minimum size of 4 bytes.
For some reason, the code generated with IA32 using
.emplace
method in Worldmap::LoadData() will cause a C++ runtime error when loading an old sfalldb.sav that is less than 8 bytes. Of course if one deletes the file from the save, things would work normally.Changing the architecture for code generation to SSE (
/arch:SSE
) can also "fix" the error without reverting the code, so yeah, yet another quirk/glitch from VS's code generation. If problems like this occur more times, I'd consider switching to SSE (PIII/Athlon XP) as the minimum requirement, and maybe add a function checking CPU features at the beginning of sfall init so ppl (if there's any) don't get crashes at start with no reason.32924db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sfalldb.sav - can I get this file?
32924db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you didn't check my RP save?
It just has 4 bytes of
0x00
, came from the saves with older sfall 4.1.x, or you can simply create one for test.From my tests your build didn't have the runtime error with it, it's probably just VS2015 toolset was acting buggy when using
/arch:IA32
.32924db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the problem is in emplace. Probably a bug is buried somewhere.
32924db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, in my previous tests I tried to comment out the whole for loop in
Worldmap::LoadData()
(obviously .emplace is gone), but the build still has runtime error with "old" sfalldb.sav.But it's the only change made on Worldmap.cpp after comparing 4.3.0.2 and 4.3.1 source code, and it does make the runtime error go away, so I revert the code.
32924db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is not what you thought, it's just that you were unlucky and the garbage value got to the wrong place)
32924db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? Does the original code in Worldmap::LoadData() has some kind of flaw?
EDIT: Ah, I saw the code change in CritterStats.cpp.