diff --git a/bin/installNoSource.nsi b/bin/installNoSource.nsi index 3f98fae22..fe69692e7 100644 --- a/bin/installNoSource.nsi +++ b/bin/installNoSource.nsi @@ -1,7 +1,7 @@ ;setup names !define PROGRAMNAME "Bridge Command 5.10" !ifndef OUTPUTFILE -!define OUTPUTFILE "..\BridgeCommand5.10.3-alpha.1.exe" +!define OUTPUTFILE "..\BridgeCommand5.10.3-alpha.3.exe" !endif !define INSTALLLOCATION "Bridge Command 5.10" !define SMFOLDER "Bridge Command 5.10" diff --git a/src/Constants.hpp b/src/Constants.hpp index a230c7276..ad2488850 100644 --- a/src/Constants.hpp +++ b/src/Constants.hpp @@ -44,7 +44,7 @@ const irr::f32 DEG_IN_RAD = 180.0 / PI; const irr::f32 RAD_PER_S_IN_DEG_PER_MINUTE = 180.0/PI * 60 ; //general definitions -const std::string LONGNAME = "Bridge Command 5.10.3-alpha.1"; +const std::string LONGNAME = "Bridge Command 5.10.3-alpha.3"; const std::string VERSION = "5.10"; -const std::string LONGVERSION = "5.10.3-alpha.1"; +const std::string LONGVERSION = "5.10.3-alpha.3"; #endif \ No newline at end of file diff --git a/src/Line.cpp b/src/Line.cpp index 22cc90a85..69d5cebb6 100644 --- a/src/Line.cpp +++ b/src/Line.cpp @@ -103,13 +103,14 @@ void Line::setEnd(irr::scene::ISceneNode* lineEnd, irr::f32 shipMass, int nodeTy } //Check we have a non-null start and end, and if so, set nominal length to the distance between them - if (lineStart && lineEnd && lineStart->getParent()) { + if (lineStart && lineEnd) { // Find distance between start and end - lineStart->getParent()->updateAbsolutePosition(); + if (lineStart->getParent()) { + lineStart->getParent()->updateAbsolutePosition(); + } lineStart->updateAbsolutePosition(); - // We don't check before if the lineEnd has a parent, as this isn't absolutely required if (lineEnd->getParent()) { lineEnd->getParent()->updateAbsolutePosition(); } @@ -313,13 +314,14 @@ void Line::update(irr::f32 deltaTime) // Calculate the force and torque acting o localForceVector = irr::core::vector3df(0.0, 0.0, 0.0); localTorqueVector = irr::core::vector3df(0.0, 0.0, 0.0); - if (lineStart && lineEnd && lineStart->getParent()) { + if (lineStart && lineEnd) { // Find distance between start and end - lineStart->getParent()->updateAbsolutePosition(); + if (lineStart->getParent()) { + lineStart->getParent()->updateAbsolutePosition(); + } lineStart->updateAbsolutePosition(); - // We don't check before if the lineEnd has a parent, as this isn't absolutely required if (lineEnd->getParent()) { lineEnd->getParent()->updateAbsolutePosition(); } diff --git a/src/Lines.hpp b/src/Lines.hpp index 2d16177eb..e0e0e0a86 100644 --- a/src/Lines.hpp +++ b/src/Lines.hpp @@ -31,8 +31,8 @@ class Lines Lines(); virtual ~Lines(); void addLine(SimulationModel* model, bool networkLine = false); // Add a line, which will be undefined - void setLineStart(irr::scene::ISceneNode* lineStart, int nodeType, int id, bool networkLine = false, int lineID = -1); //Set the start point of the line (default is most recently added line) - void setLineEnd(irr::scene::ISceneNode* lineEnd, irr::f32 shipMass, int nodeType, int id, irr::f32 lengthFactor, bool networkLine = false, int lineID = -1); //Set the end point (default is the most recently added line) + void setLineStart(irr::scene::ISceneNode* lineStart, int nodeType, int id, bool networkLine, int lineID); //Set the start point of the line (-1 for lineID is most recently added line) + void setLineEnd(irr::scene::ISceneNode* lineEnd, irr::f32 shipMass, int nodeType, int id, irr::f32 lengthFactor, bool networkLine, int lineID); //Set the end point (-1 for lineID is the most recently added line) void clearLine(int lineID, bool networkLine = false); void removeLine(int lineID, bool networkLine = false); void setSelectedLine(int lineID); diff --git a/src/MyEventReceiver.cpp b/src/MyEventReceiver.cpp index 127c26f26..4de1cba9c 100644 --- a/src/MyEventReceiver.cpp +++ b/src/MyEventReceiver.cpp @@ -2098,14 +2098,14 @@ void MyEventReceiver::handleMooringLines(irr::core::line3df rayForLines) // If connecting to another ship, find the minimum mass to use as the nominal mass for estimating default line properties nominalMass = fmin(model->getOtherShipMassEstimate(nodeID), nominalMass); } - model->getLines()->setLineEnd(contactNode, nominalMass, nodeType, nodeID, 1.0); + model->getLines()->setLineEnd(contactNode, nominalMass, nodeType, nodeID, 1.0, false, -1); // Finished linesMode = 0; gui->setLinesControlsText(""); } if (linesMode == 1) { - model->getLines()->setLineStart(contactNode, nodeType, nodeID); // Start should always be on 'own ship' so nodeType = 1, and ID does not matter (leave as 0) + model->getLines()->setLineStart(contactNode, nodeType, nodeID, false, -1); // Start should always be on 'own ship' so nodeType = 1, and ID does not matter (leave as 0) // Move on to end point linesMode = 2; gui->setLinesControlsText("Click in 3d view to set end position for line"); // TODO: Add translation @@ -2137,7 +2137,7 @@ void MyEventReceiver::handleMooringLines(irr::core::line3df rayForLines) contactPointNode->setName(terrainSceneNode->getName()); // Node ID is 0 as we always assume parent is terrain 0 - model->getLines()->setLineEnd(contactPointNode, nominalMass, 5, 0, 1.5); + model->getLines()->setLineEnd(contactPointNode, nominalMass, 5, 0, 1.5, false, -1); // Tidy up linesMode = 0; diff --git a/src/NetworkSecondary.cpp b/src/NetworkSecondary.cpp index 5c10cd85f..e5edea893 100644 --- a/src/NetworkSecondary.cpp +++ b/src/NetworkSecondary.cpp @@ -404,9 +404,12 @@ void NetworkSecondary::receiveMessage() endNode->setName(endParent->getName()); } + // Length factor can be hard coded as 1.0, as line nominal length will be updated later + irr::f32 lengthFactor = 1.0; + // Create the lines model->getLines()->setLineStart(startNode, lineStartType, lineStartID, true, i); - model->getLines()->setLineEnd(endNode, lineNominalShipMass, lineEndType, lineEndID, true, i); + model->getLines()->setLineEnd(endNode, lineNominalShipMass, lineEndType, lineEndID, lengthFactor, true, i); } } diff --git a/src/multiplayerHub/main.cpp b/src/multiplayerHub/main.cpp index e0ee1a9d9..e5cd86bb5 100644 --- a/src/multiplayerHub/main.cpp +++ b/src/multiplayerHub/main.cpp @@ -445,9 +445,10 @@ int main() linesString = linesString.substr(0,linesString.length()-1); } stringToSend.append(linesString); + stringToSend.append("#"); //12: 13 basic records in data sent, entry 12 is engine and wheel data for secondary controls, not needed, so send blank entry - stringToSend.append("12#"); + stringToSend.append("12"); //std::cout << stringToSend << std::endl;