Tank UE' Fix Possible!

DX Dark Dragon was kind enough to help look into the rumors of a UE bug and is under the impression it resides in line 260 of vehicle.cs and replacing with this file, will resolve.

We have not tried on live server to see it works, yet... to confirm.

http://pastebin.com/sHDTwbUj

Comments

  • "This paste has been removed!"
  • "This paste has been removed!"

    Didn't realize he was going to paste the link I gave him, as I only set it to last like an hour. I made a new one set for a week: http://pastebin.com/cuSTRL1Y

    The fix is experimental, as it's only implementing a thing that Meltdown 2 and BIOMod did to supposedly fix a similar issue which is to teleport the vehicle away upon being destroyed as I was told by a friend that the issue deals with clients touching the clientside ghost of the vehicle when it is destroyed which is somehow causing a crash.

    Basically, this is all it needed to modify in scripts/vehicles/vehicle.cs:
    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");
       }
       // -----------------------------------------------------------------------------------------
    }
    
  • thanks for posting the code up and if anyone at SCP is reading this and can apply the fix and bring back tanks...please do!
  • I don't know if I have ever been touching a tank when I ue'd because of them but if it works hey it works.
  • I don't know if I have ever been touching a tank when I ue'd because of them but if it works hey it works.

    It's pretty likely that it didn't have to be just you touching it. You'll probably crash if someone else touches it, along with them (likely the pilot or the gunner). But I am still waiting on getting this code in the new server to see if it alleviates the issue at all.

    Note:

    I just realized there was a syntax error. This new paste has the fixed version: http://pastebin.com/ynX1nR9x
  • Is the code in the message body the updated code? The pastebins are all expired.
  • Judging from the edit timestamps in the code paste, it may be. If he doesn't chime in just run it and see if the console says something about a syntax eror in line 260 of vehicle.cs.
  • Judging from the edit timestamps in the code paste, it may be. If he doesn't chime in just run it and see if the console says something about a syntax eror in line 260 of vehicle.cs.

    Looks like I did go about and updated the code block on the forum at some point. Though still note it's not guaranteed as I made it from a hunch I got from what I was told about how BIOMod and MD2 alleviated what appeared to be same issue.
Sign In or Register to comment.