mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-09 04:49:39 -10:00
Repro: create a prop, File -> New Mission & Discard, then create the same prop again. Asserts in model_get with "Index collision between model <other>.pof and requested model N". model_unload() walks Ship_info and Weapon_info clearing any cached model_num that pointed at the model being freed, but never did the same for Prop_info. props_level_close() only clears the prop instances, so prop_info::model_num survived the discard pointing at a freed slot. Placing that prop class again hit EditorViewport::create_object_on_grid, which reads pip->model_num directly to size the placement distance, and by then the slot had been reused by an unrelated model. Adds the matching Prop_info pass. Doing it in model_unload rather than props_level_close mirrors how the two closest analogues are handled -- Ship_info and Weapon_info are likewise class tables holding a cached handle for placeable objects -- and covers any unload path, not just level close. (asteroid_level_close solves the same problem for Asteroid_info from the other direction.) This is not OFP-specific; SCP master has props and the same missing pass.