Bläddra i källkod

If we're already there, don't try moving.

Steve Thielemann 3 år sedan
förälder
incheckning
822a7249ff
1 ändrade filer med 13 tillägg och 0 borttagningar
  1. 13 0
      scripts.cpp

+ 13 - 0
scripts.cpp

@@ -94,11 +94,24 @@ void ScriptTerror::input_notify(void) {
   // ok, step 2:  move!
   // md->setNotify([this]() { this->proxy_deactivate(); });
 
+  if (director.current_sector != ppt.s1) {
   BUGZ_LOG(fatal) << "Moving to: " << ppt.s1;
   md->move_to = ppt.s1;
   director.chain = move;
   director.chain->activate();
   return;
+  } else {
+    // We're already there!
+    to_client("Ok!  Get trading!\n\r");
+
+    td->port[0] = ppt.s1;
+    td->port[1] = ppt.s2;
+    td->trades = ppt.trades;
+    td->type = ppt.type;
+    director.chain = trader;
+    director.chain->activate();
+    return;
+  }
 }
 
 void ScriptTerror::move_notify(void) {