So yeah.

A bit of debate in IRC over the physics in Freebuild led to the discovery of a bug related to jump force and jetlag.

I'll outline the basic problem:

1. At game start (those familiar with player.cs should know this) the mass of a minifig is set at 30 and the jump force is set at 70.
2. Now, you should know, that at a jump force of only 70 and a mass of 30, a minifig can only jump about one plate high.
3. In TBGserverCmd.cs function servercmdtoggleJet both the mass and jump force of the minifig are set. The mass is set to the jetlag, and the jump force is set to twelve times the jetlag.
4. Now, this is a bad thing. Why? What's twelve times 35?
5. 430. Yeah. Exactly. This leads one to believe that they're, in fact, not playing on Earth, but the Moon.


Alright, here's my proposed solution.

1. Rewrite the Admin GUI such that "Jetlag" is renamed "Jet Force".

2. Replace the servercmdtoggleJet function with this one:

Code:
function servercmdtoggleJet(%client, %value) {
   if( %client.getRank() >= $Rank::Admin )   {
      if( %value < 0 || %value > 200)
         messageClient(%client, 'MsgAdminForce', '\c2\x96Please pick a value between 0 and 200 inclusive.');
      else {
         $Pref::Server::Jet = %value;
         for (%player=nametoid(LightMaleHumanArmor); %player<=nametoid(MWhite); %player++) {
            %player.jetJumpForce = $Pref::Server::Jet;
         }
      messageAll("MsgAdminForce", "\c2\x96Jetpack Force is now\c3 " @%value@ "\c2.");
      }
    }
}

Please note that the above code will actually work without the player having to suicide. Mainly because it doesn't change the player's mass.

3. Redefine the minifig's mass as 35 and jumpForce as 230. This will allow the minifig to jump just over seven blocks high.

4. ???

5. Victoly! Good Idea

6. This will ALSO allow the server host to define the jump force seperately from jet force. Success!

This, I believe, should solve the problem entirely.
Oooh, nice find. Thanks for the heads up. It's a good idea to submit this via our bug tracker on Bounty Source as well.
Comitted and fixed.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement