Skip to content

Commit 2dabb69

Browse files
Merge pull request #3438 from AbstractMelon/hacker-macro-fixes
fix: Correct computer core macro ignoring hacker name
2 parents 3262c73 + 46b258d commit 2dabb69

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/events/computerCore.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ const hackerNames = [
6868

6969
App.on(
7070
"computerCoreAddHacker",
71-
({id, simulatorId, level = Math.round(Math.random() * 9 + 1), cb}) => {
71+
({id, simulatorId, name, level = Math.round(Math.random() * 9 + 1), cb}) => {
7272
const computerCore = App.systems.find(
7373
s => s.class === "ComputerCore" && s.simulatorId === simulatorId,
7474
);
7575
if (!computerCore) return;
7676
computerCore.addUser({
77-
name: randomFromList(hackerNames),
77+
name: name || randomFromList(hackerNames),
7878
level,
7979
hacker: true,
8080
});

src/components/macros/computerCore.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const ComputerCoreAddHacker: React.FC<MacroConfigProps> = ({
1111
<Label>
1212
Name
1313
<Input
14-
defaultValue={args.name}
14+
value={args.name || ""}
1515
onChange={e => updateArgs("name", e.target.value)}
1616
/>
1717
<small>Leave blank for random hacker name</small>

0 commit comments

Comments
 (0)