From ce578206eb50eb14eba7a933cd7ec83e11c67f93 Mon Sep 17 00:00:00 2001 From: vmesecher Date: Sat, 25 Sep 2021 15:39:30 -0700 Subject: [PATCH] Fixes Corporation bribe uninentionally affect Bladeburners under certain circumstances. Also contains small lint fixes found by running npm run lint. --- css/popupboxes.scss | 2 +- src/Corporation/ui/BribeFactionPopup.tsx | 2 +- src/NetscriptFunctions.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/css/popupboxes.scss b/css/popupboxes.scss index 057e31715..c535fee0f 100644 --- a/css/popupboxes.scss +++ b/css/popupboxes.scss @@ -25,7 +25,7 @@ overflow-y: auto; z-index: 11; /* Sit on top of the container */ color: var(--my-font-color); - box-shadow: 0px 3px 5px -1px #090, 0px 5px 8px 0px #090, 0px 1px 14px 0px #090; + box-shadow: 0 3px 5px -1px #090, 0 5px 8px 0 #090, 0 1px 14px 0 #090; } .popup-box-input-div { diff --git a/src/Corporation/ui/BribeFactionPopup.tsx b/src/Corporation/ui/BribeFactionPopup.tsx index 3fe8464a4..5b85a32d9 100644 --- a/src/Corporation/ui/BribeFactionPopup.tsx +++ b/src/Corporation/ui/BribeFactionPopup.tsx @@ -17,7 +17,7 @@ export function BribeFactionPopup(props: IProps): React.ReactElement { const [money, setMoney] = useState(0); const [stock, setStock] = useState(0); const [selectedFaction, setSelectedFaction] = useState( - props.player.factions.length > 0 ? props.player.factions[0] : "", + props.player.factions.length > 0 ? props.player.factions.filter(faction => Factions[faction].getInfo().offersWork())[0] : "" ); function onMoneyChange(event: React.ChangeEvent): void { diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 1be026f79..aa6a3fa71 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -375,7 +375,7 @@ function NetscriptFunctions(workerScript: WorkerScript): NS { }; // Utility function to get Hacknet Node object - const getHacknetNode = function (i: any, callingFn: string = ""): HacknetNode | HacknetServer { + const getHacknetNode = function (i: any, callingFn = ""): HacknetNode | HacknetServer { if (isNaN(i)) { throw makeRuntimeErrorMsg(callingFn, "Invalid index specified for Hacknet Node: " + i); }