I was playing a minigame in the Kitchen, and pretty much every kill was a midair kill, triggering the "win" sound and a bottomprint on everyone's hud.
This is kinda annoying.
The code for midair kills is buried in base/server/scripts/game.cs.dso. It seems the code will not detect a TSStatic object(used for collision in kitchen) as a piece of ground.
The midair kill code uses commandtoclient(%client,'bottomprint',%msg,%time); to send the message, instead of bottomprint(%client,%msg,%time). I was unable to hook into commandtoclient to do any sort of filtering(that would have been a bad idea anyway) so instead, I wrong a bit of code that teleports a player to 0, 0, 5 as they die, allows the midair-kill stuff to function, and then teleports the resulting corpse back to the player's original position.
In this way no midair kills are detected.
However it finds the player's corpse using the client's camera. So if for some reason the client's camera is NOT focused on their dead body, this script will leave the corpse in a weird place. :c
But it you're having trouble with midair kill detection returning false positives, feel free to package it up and add it to your game. It might help.
if(isPackage(testpackage))
deactivatepackage(testpackage);
package testpackage
{
function gameConnection::onDeath(%client, %killerPlayer, %killer, %damageType, %unknownA)
{
%client.mabpos = %client.player.getTransform();
%client.player.setTransform("0 0 5 1 0 0 0");
parent::onDeath(%client, %player, %killer, %damageType, %unknownA);
if(isObject(%client.camera))
{
if(%client.camera.mode $= "Corpse")
{
%corpse = %client.camera.getOrbitObject();
%corpse.setTransform(getWords(%client.mabpos,0,2) SPC getWords(%corpse.getTransform(),3,6));
}
}
}
};
activatepackage(testpackage);