diff --git a/Classic/scripts/autoexec/TacoOverrides.cs b/Classic/scripts/autoexec/TacoOverrides.cs index aea7bcc..244519c 100644 --- a/Classic/scripts/autoexec/TacoOverrides.cs +++ b/Classic/scripts/autoexec/TacoOverrides.cs @@ -25,6 +25,54 @@ function serverCmdEndThrowCount(%client, %data) %client.player.throwStart = 5; //was 0 } +//Tank UE code by Keen +//To fix tank UE by transporting the tank far away so nothing bumps into it causing a UE +function VehicleData::onDestroyed(%data, %obj, %prevState) +{ + if(%obj.lastDamagedBy) + { + %destroyer = %obj.lastDamagedBy; + game.vehicleDestroyed(%obj, %destroyer); + //error("vehicleDestroyed( "@ %obj @", "@ %destroyer @")"); + } + + radiusVehicleExplosion(%data, %obj); + if(%obj.turretObject) + if(%obj.turretObject.getControllingClient()) + %obj.turretObject.getDataBlock().playerDismount(%obj.turretObject); + for(%i = 0; %i < %obj.getDatablock().numMountPoints; %i++) + { + if (%obj.getMountNodeObject(%i)) { + %flingee = %obj.getMountNodeObject(%i); + %flingee.getDataBlock().doDismount(%flingee, true); + %xVel = 250.0 - (getRandom() * 500.0); + %yVel = 250.0 - (getRandom() * 500.0); + %zVel = (getRandom() * 100.0) + 50.0; + %flingVel = %xVel @ " " @ %yVel @ " " @ %zVel; + %flingee.applyImpulse(%flingee.getTransform(), %flingVel); + echo("got player..." @ %flingee.getClassName()); + %flingee.damage(0, %obj.getPosition(), 0.4, $DamageType::Crash); + } + } + + %data.deleteAllMounted(%obj); + // ----------------------------------------------------------------------------------------- + // z0dd - ZOD - Czar, 6/24/02. Move this vehicle out of the way so nothing collides with it. + if(%data.getName() $="BomberFlyer" || %data.getName() $="MobileBaseVehicle" || %data.getName() $="AssaultVehicle") + { + // %obj.setFrozenState(true); + %obj.schedule(2000, "delete"); + //%data.schedule(500, 'onAvoidCollisions', %obj); + %obj.schedule(500, "setPosition", vectorAdd(%obj.getPosition(), "40 -27 10000")); + } + else + { + %obj.setFrozenState(true); + %obj.schedule(500, "delete"); + } + // ----------------------------------------------------------------------------------------- +} + }; // Prevent package from being activated if it is already