beyond-all-reason / beyond-all-reason/RecoilEngine

Get rid of death NOWEAPON, and possibly NoWeapon type

Open
#1,043 0 comments 0 reactions 0 assignees View on GitHub
game compat refactor
Dominant language
C++
Stars
683
Forks
293
Avg merge
3d 2h
Merged PRs (30d)
40

Description

1) `explodeAs` and `selfDestructAs` (unit def tags for death explosions) accept a weapon def name. If this does not refer to a valid weapon, an attempt is made to set it to the weapon with the name "NOWEAPON". But if that weapon doesn't exist, it is just left null and everything is fine. Remove the middleman and just leave it null if the original weapon doesn't exist, since "NOWEAPON" does essentially nothing anyway. It may not necessarily be strictly nothing (idk, maybe it triggers `Explosion` or other weapon-related Lua events? but see below) so check that for changelog reasons.

2) having the name "NOWEAPON" sets the weapon's type to `NoWeapon`, also achieved via invalid weaponType. Check if it can be removed. As far as I can tell it isn't completely without purpose because it fills gaps (i.e. without it, weapon 2 in the unit def file would not always end up as 2, because it could shift if weapon 1 is invalid), but perhaps it's better to just drops units with invalid weapons anyway and leave an informative error message in the infolog? Ideally check if/how games use NOWEAPON.

Contributor guide

Open the contributing guide

Research direction

Trace the unit-definition handling for `explodeAs`, `selfDestructAs`, invalid `weaponType` values, and the `NOWEAPON`/`NoWeapon` paths. Check whether `NOWEAPON` triggers `Explosion` or other weapon-related Lua events, and inspect games using it. Done means the behavior is understood, the compatibility impact is recorded for the changelog, and any removal or replacement reports invalid weapons clearly in the infolog.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.