There have also been some stability improvements this month. Most of these are invisible to the player, but it's worth mentioning.
- Refactored the way damage is transmitted between different parts of the game code. This used to use the built-in DamageInfo struct included in s&box, but this has now been changed to a custom struct derived from DamageInfo. This allows for code to be much cleaner and safer.
It also allowed me to get rid of this snippet of code, which I thought was too humorous not to share.
// HACK: This is fucking terrible. For some godforsaken reason,
// the bots do not place nice with PositionHeldObject and HeldProp.
// I've tried everything I can think of, but HeldProp just randomly
// goes null sometimes and throws an exception. It's probably something
// to do with the prop pickup code, but I don't even know where to begin
// to look. Maybe when I am smarter, I can get rid of this stupid
// exception blocker.
try
{
if ( HeldGameObject is not null && HeldProp is not null )
{
PositionHeldObject();
}
}- The killfeed should now render names and prop killfeed icons much more reliably, thanks to the aforementioned damage transmission changes.
- Props that are destroyed while held by a player should now be cleaned up properly. In addition, propls held by the player are now properly ignored in collision interactions.
- Props now spawn correctly over the network once again.
- Props should no longer throw exceptions when broken.