Fixed Couple Bugs and Crashes

- Fixed: Crash when Hacking With No Tools
- Fixed: Accessing directories outside of C:\ShiftOS using 'ls' command
- Added Small Features
This commit is contained in:
carverh 2016-07-20 20:47:35 -07:00
parent 4fe0de40aa
commit 2747ec98b7
3 changed files with 74 additions and 65 deletions

View file

@ -1377,10 +1377,17 @@ public string GetPath(string path)
}
public string GetParent(string path)
{
if (new DirectoryInfo(path).Parent.FullName.Contains("ShiftOS"))
{
var d = new DirectoryInfo(path);
return d.Parent.FullName;
}
else
{
return path;
}
}
public void DoCommand()
{

View file

@ -373,9 +373,17 @@ public static void StartHack(int cid, string upgrade)
{
StartHack(cid, GetRandomHack());
}
else {
var h = Tools[cid];
switch(h.Name)
else
{
if (Tools.Count <= cid)
{
API.CreateInfoboxSession("Failed!", "No Hacking Tools Avalible!", infobox.InfoboxMode.Info);
return;
}
else
{
HackTool h = Tools[cid];
switch (h.Name)
{
case "Destabilizer Attack":
var t = new Timer();
@ -384,7 +392,7 @@ public static void StartHack(int cid, string upgrade)
t.Tick += (object s, EventArgs a) =>
{
int r = rnd.Next(0, 100);
if(r == 90)
if (r == 90)
{
t.Stop();
API.CreateInfoboxSession("Hack complete.", "The hack has been completed.", infobox.InfoboxMode.Info);
@ -393,7 +401,7 @@ public static void StartHack(int cid, string upgrade)
else
{
int p = rnd.Next(0, 10);
switch(p)
switch (p)
{
case 1:
API.OpenProgram("shiftorium");
@ -432,6 +440,7 @@ public static void StartHack(int cid, string upgrade)
}
}
}
}
/// <summary>
/// Initiates the Hacker Battle training simulation.

View file

@ -1,18 +1,11 @@
ShiftOS #VER#
== Developers ==
Philip Adams
Michael VanOverbeek
Carver (www.harri.cf)
A game by Michael VanOverbeek
== External Libraries / Dependencies ==
== External Libraries / Dependencies ==
JSON.NET - Version 8.0.2
By James Newton-King