-
Notifications
You must be signed in to change notification settings - Fork 33
Load old ObjectData correctly #553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -390,6 +390,7 @@ class OLD_OBJECTTYPE_101 | |
| UINT8 fUsed; // flags for whether the item is used or not | ||
| }; | ||
|
|
||
|
|
||
| namespace ObjectDataStructs { | ||
| struct OBJECT_GUN | ||
| { | ||
|
|
@@ -439,7 +440,56 @@ namespace ObjectDataStructs { | |
| INT8 bLBE; // Marks item as LBENODE | ||
| int uniqueID; // how the LBENODE is accessed | ||
| }; | ||
|
|
||
| // Used to maintain compatibility with major map versions older than 8.0 | ||
| struct OBJECT_BOMBS_AND_OTHER_PRE_ITS | ||
| { | ||
| INT16 bBombStatus; | ||
| INT8 bDetonatorType; | ||
| UINT16 usBombItem; | ||
| union | ||
| { | ||
| INT8 bDelay; | ||
| INT8 bFrequency; | ||
| }; | ||
| UINT8 ubBombOwner; //<-- Data size changed | ||
| UINT8 bActionValue; | ||
| union | ||
| { | ||
| UINT8 ubTolerance; | ||
| UINT8 ubLocationID; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
||
|
|
||
| struct ObjectData_PRE_ITS | ||
| { | ||
| union { | ||
| INT16 objectStatus;//holds the same value as bStatus[0] | ||
| UINT16 ubShotsLeft;//holds the same value as ubShotsLeft[0] | ||
| ObjectDataStructs::OBJECT_GUN gun; | ||
| ObjectDataStructs::OBJECT_MONEY money; | ||
| ObjectDataStructs::OBJECT_BOMBS_AND_OTHER_PRE_ITS misc; | ||
| ObjectDataStructs::OBJECT_KEY key; | ||
| ObjectDataStructs::OBJECT_OWNER owner; | ||
| ObjectDataStructs::OBJECT_LBE lbe; | ||
| }; | ||
| INT8 bTrap; // 1-10 exp_lvl to detect | ||
| UINT8 fUsed; // flags for whether the item is used or not | ||
| UINT8 ubImprintID; // ID of merc that item is imprinted on | ||
| char endOfPOD; // For WF maps | ||
| FLOAT bTemperature; // Flugente FTW 1.2: temperature of gun | ||
|
majcosta marked this conversation as resolved.
|
||
| UINT8 ubDirection; // direction the bomb faces (for directional explosives) | ||
| UINT32 ubWireNetworkFlag; // flags for the tripwire network | ||
| INT8 bDefuseFrequency; // frequency for defusing, >=0 values used only | ||
| INT16 sRepairThreshold; // repair only possible up to this value | ||
| FLOAT bFiller; // unused for now | ||
| UINT64 sObjectFlag; // used to notify of various states that apply to this object, but not the item in general | ||
| }; | ||
| // Flugente: needed for reading WF maps | ||
| #define SIZEOF_OBJECTDATA_POD_PRE_ITS (offsetof(ObjectData_PRE_ITS, endOfPOD)) | ||
|
|
||
|
|
||
| class ObjectData | ||
| { | ||
|
|
@@ -451,6 +501,8 @@ class ObjectData | |
| ObjectData(const ObjectData&); | ||
| // Assignment operator | ||
| ObjectData& operator=(const ObjectData&); | ||
| // Conversion operator | ||
| ObjectData& operator=(const ObjectData_PRE_ITS&); | ||
|
|
||
|
|
||
| void initialize() {memset(this, 0, sizeof(ObjectData));}; | ||
|
|
@@ -474,7 +526,7 @@ class ObjectData | |
| UINT8 fUsed; // flags for whether the item is used or not | ||
| UINT8 ubImprintID; // ID of merc that item is imprinted on | ||
|
|
||
| // Flugente: due do inconsistencies with WF maps, where data from a map is laoded differently, I had to add this marker. | ||
| // Flugente: due do inconsistencies with WF maps, where data from a map is loaded differently, I had to add this marker. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do this in its own PR
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :( |
||
| // New values, like bTemperature, have to come after this. And please, don't destroy ObjectData's POD-ness. | ||
| char endOfPOD; | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
do this in its on PR