mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
Merge pull request #38 from danielyxie/dev
FIxed a bug with manuallyHacked flag
This commit is contained in:
commit
d47cda8a8d
@ -280,7 +280,6 @@ var Terminal = {
|
||||
finishHack: function(cancelled = false) {
|
||||
if (cancelled == false) {
|
||||
var server = Player.getCurrentServer();
|
||||
server.manuallyHacked = true;
|
||||
|
||||
//Calculate whether hack was successful
|
||||
var hackChance = Player.calculateHackingChance();
|
||||
@ -289,6 +288,7 @@ var Terminal = {
|
||||
var expGainedOnSuccess = Player.calculateExpGain();
|
||||
var expGainedOnFailure = (expGainedOnSuccess / 4);
|
||||
if (rand < hackChance) { //Success!
|
||||
server.manuallyHacked = true;
|
||||
var moneyGained = Player.calculatePercentMoneyHacked();
|
||||
moneyGained = Math.floor(server.moneyAvailable * moneyGained);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user