GithubHelp home page GithubHelp logo

endless-sky / endless-sky-delta Goto Github PK

View Code? Open in Web Editor NEW

This project forked from endless-sky/endless-sky

8.0 5.0 0.0 403.64 MB

Space exploration, trading, and combat game. Rapid Development and Experimentation fork.

Home Page: https://endless-sky.github.io/

License: GNU General Public License v3.0

Shell 0.29% C++ 96.96% Python 1.66% C 0.13% CMake 0.82% Roff 0.14%

endless-sky-delta's Issues

Incorrect logic in Ship::Move breaks Command::STOP

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When the AI decides to stop the ship, sometimes it can't. This happens due to an error in the new thrusting logic. Sometimes, the code will ignore dragAcceleration, which is the variable Ship::Move uses to implement Command::STOP when the ship is almost stopped. This prevents ships from boarding, landing, assisting, and a variety of other things, if they happen to be moving at just the right speed. That's why the integration tests are failing.

Steps to Reproduce

Run the integration tests a few times on Ubuntu 20 or 22 using GL. Watch Capture Uncapturable With Capturable Override fail.

Expected Behavior

Ships can stop. All integration tests should pass.

Screenshots

No response

Link to save file

No response

Operating System

Ubuntu 22

Game Source

Built from source

Game Version

e1004d1

Additional Information

This is the fix:

diff --git a/source/Ship.cpp b/source/Ship.cpp
index 61d4b668c..47fa1f485 100644
--- a/source/Ship.cpp
+++ b/source/Ship.cpp
@@ -2249,7 +2249,7 @@ void Ship::Move(vector<Visual> &visuals, list<shared_ptr<Flotsam>> &flotsam)
                                if((aNormal > 0.) != (vNormal > 0.) && fabs(aNormal) > fabs(vNormal))
                                        dragAcceleration = -vNormal * angle.Unit();
                        }
-                       if(velocity.Length() > MaxVelocity() || velocity.Length() < 0.1)
+                       if(commands.Has(Command::STOP) || velocity.Length() > MaxVelocity() || velocity.Length() < 0.1)
                                velocity += dragAcceleration;
                        else
                                velocity += acceleration;

I don't want to do a PR until the conflicts between master and experimental are resolved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.