mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-31 22:19:44 +01:00
Fix platv values outside map size being saved as 67372036
If the map size was less than 20x20, platv values outside the map would end up being saved as 67372036. This happens because SDL_memset() operates on the byte level, and not the multi-byte level. So it takes only the lower 8 bits of 4 and repeats it for each byte in each integer, creating 67372036.
This commit is contained in:
parent
07bbc5b2de
commit
6f499abef0
1 changed files with 4 additions and 1 deletions
|
@ -1366,7 +1366,10 @@ bool customlevelclass::save(const std::string& _path)
|
|||
msg = xml::update_element_delete_contents(data, "levelMetaData");
|
||||
|
||||
int temp_platv[numrooms];
|
||||
SDL_memset(temp_platv, 4 /* default */, sizeof(temp_platv));
|
||||
for (size_t i = 0; i < SDL_arraysize(temp_platv); ++i)
|
||||
{
|
||||
temp_platv[i] = 4; /* default */
|
||||
}
|
||||
|
||||
if (mapwidth < maxwidth)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue