13,158 Commits over 2,830 Days - 0.19cph!
Override ToString in the TimeSince classes. This makes the actual elapsed time show in a debug log automatically (even without a .ToString()), without having to cast it to float.
Partial setup of the caboose as a working train carriage
Added missing ladder volumes to the loot wagon
Removed extra TrainWagonA ladder volumes
Moved all train car ladder volumes under the Shared GameObject
Fixed missing train car assignments
Removed duplication in train audio code. TrainEngineAudio is now a subclass of TrainCarAudio.
If the Place Monument component has no monument assigned, don't try to place it.
Merge PerentVelocityInherit -> Main. Train wagons now support parented vehicles correctly, and velocity is correctly retained.
When a rigidbody is parented to another rigidbody, the child rigidbody actually inherits the velocity even while parented. Therefore the forced velocity change in OnParentChanging was actually doubling-up the velocity in those cases.
I've set it to NOT adjust the velocity in the case of the parent having its own rigidbody, and that's fixed it, apart from a remaining momentary jitter when entering and leaving the trigger (as seen here when the minicopter transitions across the wagon's trigger: https://files.facepunch.com/BillB/1b2311b1/Unity_qLfRWyks5e.mp4). I wonder if it's now a client interpolation issue.
Disable vehicle parenting on workcarts and locomotive (already disabled on wagons). We shouldn't really have this enabled unless we can get physics velocity to translate properly when entering/leaving the parenting zone.
Enabled vehicle parenting for all train car parent triggers
Fixed train collision triggers getting the wrong base entity if an entity with a rigidbody entered the collision trigger while parented to the train car.
Tell cars not to sleep if they're parented to another rigidbody. Mainly because Unity doesn't seem to allow it anyway (even if the parent rigidbody is asleep)
Added repel + damage triggers to locomotive and wagons, and re-enabled it for the workcart (was disabled in
59352 due to a bug).
Merge TrainWorkContinued -> Main
Get hurtTiggerUser once, instead of every tick
- Added methods to check all, or individual, train track splines in prefabs for potential tangent issues.
- Fixed up the dodgy tangents in four train tunnel prefabs.
- Removed the temporary workaround for the broken ones, and some now-unused methods.
- Regenerated spline data.
- Some formatting.
One remaining problem with the updated splines joining up so this can't go on Main just yet.
Fixed getting hit by trains sometimes parenting the player instead of damaging them
Merge TrainWorkContinued -> Main
Trains now check for available space BEFORE spawning, and try a new position if needed
Updated wagon gibs to the new wagon colours
Fixed up gibs for WagonA/WagonB/WagonC
Added death screen names and icons for modular car deaths, and for snowmobile deaths
Added missing train entity in death screen list
- Added death screen icons and names for all the new train components.
- Fixed a couple of bugs with train wagon gibs.
OnPostFill virtual method fix
Spawn some extra train engines if there aren't enough to fill all sidings
Spawn one train engine at every siding before moving on to spawning the rest of them randomly. At low spawn populations, there may still not be enough engines to have one per siding
Merge Main -> TrainWorkContinued
Merge TrainWorkContinued -> Main (general bug fixes)
Code review: Added divide-by-zero check.
Code review: Save GC with orePlaneRenderers.
Merge Main -> TrainWorkContinued
Disable the ore plane gameobjects when the transform scale is at zero (less efficient than disabling just the renderers, but since there are multiple LODs this keeps it simple)
Merge MoreTrainFixes -> TrainWorkContinued
Added traincar.decayminutes and traincarunloadable.decayminutesafterunload convars for decay times
Fixed not being able to enter the locomotive's rear door on upward inclines
Fixed wagon unload animation not ending if the wagon moved away from the vacuum while being unloaded
Additional null check in SpaceIsClear. Fixes NRE when a train spawns inside a collider which isn't an entity
Improved wagons flying away too fast when uncoupled, or after collisions
Fixed two situations where train cars would end up with the reverse of the speed they should have after coupling or uncoupling