Skip to content

fix: e interacts from the distance the header promises (#8) - #38

Open
blippip69 wants to merge 1 commit into
Bitcoindefi:mainfrom
blippip69:fix/npc-interaction-range
Open

fix: e interacts from the distance the header promises (#8)#38
blippip69 wants to merge 1 commit into
Bitcoindefi:mainfrom
blippip69:fix/npc-interaction-range

Conversation

@blippip69

Copy link
Copy Markdown
Contributor

fix: e interacts from the distance the header promises (#8)

view() offers e hablar from two cells away via nearbyNpc(2), but enter() listened with the default range of 1, so pressing e at the advertised distance answered aca no hay nada. Both sides now use the same range.
@blippip69
blippip69 force-pushed the fix/npc-interaction-range branch from a46019d to 92ceaed Compare August 25, 2026 16:18
Comment thread test/index.js
Comment on lines 1200 to +1202
game.drain(game.field.boss.touch(game.field.player, game.field.time + 20))
t.is(game.player.hp, life - 6, 'field contact updates the persistent character sheet')
test('e reaches the resident the header promises, two cells away (#8)', (t) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Bug: World-boss test missing closing }) breaks whole suite

The test('the world boss animates powers with real field damage', ...) block opened at line 1120 is never closed: line 1201 ends with a t.is(...) assertion and line 1202 immediately starts the next test(...) with no intervening }). node --check test/index.js fails with SyntaxError: Unexpected end of input, so the file cannot be parsed and no tests in the suite run. Add the missing }) after line 1201 to close the arrow callback and the test( call.

Close the world-boss test callback before the next test declaration.:

  t.is(game.player.hp, life - 6, 'field contact updates the persistent character sheet')
})

test('e reaches the resident the header promises, two cells away (#8)', (t) => {
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
CI failed: CI failed due to a syntax error and formatting check failure in test/index.js from missing code structure.

Overview

Two failures occurred in the CI pipeline across jobs: a Prettier formatting/syntax error check failed on test/index.js, and the test suite failed to execute due to a matching syntax error (unexpected end of input). Both issues are directly related to code changes in this PR.

Failures

Prettier Formatting and Syntax Error (confidence: high)

  • Type: tooling
  • Affected jobs: 98040959777
  • Related to change: yes
  • Root cause: Prettier encountered an unexpected token at line 1220:1 in test/index.js.
  • Suggested fix: Inspect test/index.js around line 1220 to fix syntax errors, mismatched brackets, or formatting issues.

Test Execution Syntax Error (confidence: high)

  • Type: build
  • Affected jobs: 98040959837
  • Related to change: yes
  • Root cause: A syntax error (Unexpected end of input) exists in the test files being loaded by the test runner, likely caused by unclosed parentheses, braces, or brackets.
  • Suggested fix: Review recent changes in test/index.js and source files to resolve all syntax errors and unclosed constructs.

Summary

  • Change-related failures: 2 failures (Prettier check failure and test execution syntax error caused by code syntax issues in test files)
  • Infrastructure/flaky failures: 0 failures
  • Recommended action: Fix the syntax errors and unclosed blocks in test/index.js and re-run the CI checks.
Code Review 🚫 Blocked 0 resolved / 1 findings

Fixes NPC interaction range issues to match header specifications, but the world-boss test is missing a closing parenthesis that breaks the entire suite.

🚨 Bug: World-boss test missing closing }) breaks whole suite

📄 test/index.js:1200-1202 📄 test/index.js:1120

The test('the world boss animates powers with real field damage', ...) block opened at line 1120 is never closed: line 1201 ends with a t.is(...) assertion and line 1202 immediately starts the next test(...) with no intervening }). node --check test/index.js fails with SyntaxError: Unexpected end of input, so the file cannot be parsed and no tests in the suite run. Add the missing }) after line 1201 to close the arrow callback and the test( call.

Close the world-boss test callback before the next test declaration.
  t.is(game.player.hp, life - 6, 'field contact updates the persistent character sheet')
})

test('e reaches the resident the header promises, two cells away (#8)', (t) => {
🤖 Prompt for agents
Code Review: Fixes NPC interaction range issues to match header specifications, but the world-boss test is missing a closing parenthesis that breaks the entire suite.

1. 🚨 Bug: World-boss test missing closing `})` breaks whole suite
   Files: test/index.js:1200-1202, test/index.js:1120

   The `test('the world boss animates powers with real field damage', ...)` block opened at line 1120 is never closed: line 1201 ends with a `t.is(...)` assertion and line 1202 immediately starts the next `test(...)` with no intervening `})`. `node --check test/index.js` fails with `SyntaxError: Unexpected end of input`, so the file cannot be parsed and no tests in the suite run. Add the missing `})` after line 1201 to close the arrow callback and the `test(` call.

   Fix (Close the world-boss test callback before the next test declaration.):
     t.is(game.player.hp, life - 6, 'field contact updates the persistent character sheet')
   })
   
   test('e reaches the resident the header promises, two cells away (#8)', (t) => {

Tip

Comment Gitar fix CI or enable auto-apply: gitar auto-apply:on

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Important

Your trial ends in 7 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

@leocagli

Copy link
Copy Markdown
Collaborator

Thanks for this one. The fix itself is right, and it is the better of the two
proposals for #8: changing only the call site and leaving the range = 1 default
alone is the more surgical choice.

But the PR cannot be merged as it stands, because the test file does not parse.

Merged onto current main:

$ npm test
> brittle-bare test/index.js

SyntaxError: Unexpected end of input
    at Module._extensions..cjs (bare:/bare.bundle/node_modules/bare-module/index.js:847:30)

The whole suite fails to load, so not a single test runs.

Where it comes from

The new test was inserted before the closing }) of the previous test in
test/index.js. The block that ends the world boss animates powers with real field damage never closes, and the file ends one brace short:

  t.is(game.player.hp, life - 6, 'field contact updates the persistent character sheet')
test('e reaches the resident the header promises, two cells away (#8)', (t) => {
  ...
})

Closing the previous test before opening the new one should be all it takes.

While you are in there

npm run lint also fails on this branch. npm run format fixes it.

After that, npm test should report 65 tests and 515 assertions as a baseline, plus
whatever your test adds. Ping here when it is pushed and I will re-run it.

@leocagli

Copy link
Copy Markdown
Collaborator

El CI ya corrio (habilite la ejecucion, estaba esperando aprobacion de mantenedor). Dejé el detalle de todos tus PRs juntos en #50 para no repetirlo seis veces: #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants