mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-06 17:09: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
406a19ceb6
commit
3c6cb0167d
1 changed files with 4 additions and 1 deletions
|
@ -2232,7 +2232,10 @@ bool editorclass::save(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