dronekill.h: the header says the module never writes, then describes it writing game memory

Open Beginner friendly
#2,912 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
documentation

Research direction

Read src/quest/combat/dronekill.h lines 12–20 alongside src/quest/combat/dronekill.cpp lines 553–557. Update the header to accurately distinguish the module’s reads, state-changing calls, and memory writes, or split those into separate lists. Done when the heading and descriptions match the behavior shown in the implementation.

Written by the indexing model from the issue text.

Description

bug

Found by a code-smell sweep over the kept combat code and verified by reading the code on the release.

Evidence at 1ab81980e (release/v6.20.0)
  • src/quest/combat/dronekill.h, line 12: What it calls (never writes): .... The list that follows names DisableComponent and EnableComponent (vtable calls that change a component's state), and the same header, about line 20, describes the module writing game memory: "its state word at +0x18 zeroed round each and put back after both". The module does write: dronekill.cpp lines 553 to 557 set the state word at the context's +0x18 to 0 before each entry and back to the saved value after both. The sentence is false for the module the header describes.
  • The module is not installed in this build (the header's own first lines say so; no row in src/quest/combat/combat_install.cpp), so nothing misbehaves; the comment misleads the reader who decides what the module may do.
Not shown
  • That the header's list of reads is incomplete otherwise.
Falsifier

Read dronekill.h lines 12 to 20 and dronekill.cpp lines 553 to 557: a write to game memory and two state-changing vtable calls, under a heading that says "never writes".

Work
  1. Reword the heading to say what the module reads, what it calls that changes state, and what it writes, or split the list.
Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.