Repository navigation
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
CElement::OutputToXMLonly wrote custom data and child nodes, so every element saved bysaveMapDatacame out empty (<object>) and the file could not be loaded backAdds
CElement::WriteSpecialData, the counterpart ofReadSpecialData, and implements it for every element type the map loader supports: object, building, vehicle, ped, pickup, marker, blip, radar area, team, water and dummy. also writes the sharedid/attachToattributes and addsXMLColorFromIntfor colour attributesColshapes are left out on purpose - they have no XML loading path, both map loaders fall through to a dummy element for them
Also teaches
loadMapDataabout<building>nodes, whichCResourceMapItemalready supportedThis PR also fixes #1473
Test plan
Created one of each element type, saved them with
saveMapData, then loaded the resulting file back withloadMapDataBefore ->
<object note="custom data" />After ->
<object model="1337" posX="1.000000" posY="2.000000" posZ="3.000000" rotX="0.000000" ... alpha="255" scale="1.000000" note="custom data" />Checklist