Example #1
0
        private void OnDamageVehicleRequested(CSteamID instigatorSteamID, InteractableVehicle vehicle, ref ushort pendingTotalDamage, ref bool canRepair, ref bool shouldAllow, EDamageOrigin damageOrigin)
        {
            UnturnedVehicleDamagingEvent @event = new UnturnedVehicleDamagingEvent(new UnturnedVehicle(vehicle), instigatorSteamID, pendingTotalDamage, damageOrigin, canRepair);

            Emit(@event);

            pendingTotalDamage = @event.PendingTotalDamage;
            canRepair          = @event.CanRepair;
            shouldAllow        = [email protected];
        }
Example #2
0
        private void OnDamageVehicleRequested(CSteamID instigatorSteamId, InteractableVehicle vehicle, ref ushort pendingTotalDamage, ref bool canRepair, ref bool shouldAllow, EDamageOrigin damageOrigin) // lgtm [cs/too-many-ref-parameters]
        {
            var @event = new UnturnedVehicleDamagingEvent(
                vehicle: new UnturnedVehicle(vehicle),
                instigator: instigatorSteamId == CSteamID.Nil ? null : instigatorSteamId,
                pendingTotalDamage: pendingTotalDamage,
                damageOrigin: damageOrigin,
                canRepair: canRepair)
            {
                IsCancelled = !shouldAllow
            };

            Emit(@event);

            pendingTotalDamage = @event.PendingTotalDamage;
            canRepair          = @event.CanRepair;
            shouldAllow        = [email protected];
        }