Skip to content
Snippets Groups Projects
Forked from STJr / SRB2
Source project has a limited visibility.
  • Inuyasha's avatar
    55f0e5ca
    objectplace stability fix · 55f0e5ca
    Inuyasha authored
    Objectplace reallocates the mapthings list to add one more mapthing. By itself there's no problem with this.
    But, mobj->spawnpoint is a pointer to the mapthing's location in the mapthings list.
    So by reallocating the mapthings list, all references to mobj->spawnpoints point to freed memory.
    
    ... Oops.
    
    Now when objectplace reallocates the mapthings list it actually corrects the locations of all mobj's spawnpoints to point to the new list.
    
    Hooray, you can use NiGHTS objectplace again if you really want to.
    55f0e5ca
    History
    objectplace stability fix
    Inuyasha authored
    Objectplace reallocates the mapthings list to add one more mapthing. By itself there's no problem with this.
    But, mobj->spawnpoint is a pointer to the mapthing's location in the mapthings list.
    So by reallocating the mapthings list, all references to mobj->spawnpoints point to freed memory.
    
    ... Oops.
    
    Now when objectplace reallocates the mapthings list it actually corrects the locations of all mobj's spawnpoints to point to the new list.
    
    Hooray, you can use NiGHTS objectplace again if you really want to.