OnAirdrop
OxideCarbonEntityCalled when airdrop occurs.
void OnAirdrop(CargoPlane cargoPlane, Vector3 newDropPosition)Works — the game method in this build is the one the hook was written for.
Parameters
- cargoPlane
- CargoPlane
- newDropPosition
- Vector3
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnAirdrop(CargoPlane cargoPlane, Vector3 newDropPosition)
{
Puts("OnAirdrop");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
void CargoPlane.UpdateDropPosition(Vector3)
Passes: CargoPlane cargoPlane, Vector3 newDropPosition
WorksReturnBehavior: ContinueArgumentBehavior: AllAssembly-CSharp.dll
Where it is called (this branch's game code)
// …
endPos.y = startPos.y;
startPos += newDropPosition;
endPos += newDropPosition;
secondsToTake = Vector3.Distance(startPos, endPos) / 50f;
secondsToTake *= Random.Range(0.95f, 1.05f);
transform.position = startPos;
transform.rotation = Quaternion.LookRotation(endPos - startPos);
dropPosition = newDropPosition;
Interface.CallHook("OnAirdrop", this, newDropPosition);
}Sources: Rust.opj from OxideMod/Oxide.Rust (MIT) and hook metadata of the Carbon documentation (MIT). Method code is decompiled from this branch's server.