add spawn height offset

This commit is contained in:
NotAKidoS 2023-04-12 15:36:37 -05:00
parent a202f6f987
commit 652348157a

View file

@ -143,7 +143,12 @@ public class PropUndoButton : MelonMod
// Add the spawned prop to the history of deleted props // Add the spawned prop to the history of deleted props
if (deletedProps.Count >= redoHistoryLimit) deletedProps.RemoveAt(0); // Remove the oldest item if (deletedProps.Count >= redoHistoryLimit) deletedProps.RemoveAt(0); // Remove the oldest item
DeletedProp deletedProp = new DeletedProp(propData.ObjectId, propData.Spawnable.transform.position, propData.Spawnable.transform.rotation);
// offset spawn height so game can account for it later
Vector3 position = propData.Spawnable.transform.position;
position.y -= propData.Spawnable.spawnHeight;
DeletedProp deletedProp = new DeletedProp(propData.ObjectId, position, propData.Spawnable.transform.rotation);
deletedProps.Add(deletedProp); deletedProps.Add(deletedProp);
PlayAudioModule(sfx_undo); PlayAudioModule(sfx_undo);