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

gadget:AllowWeaponTarget is uncessarily overloaded

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

Description

If targetID is -1, then it means "please tell me the target acquisition range for this slow update". This extra use was added in 2018, and as far as I know, raaar (Metal Faction) is still using it: https://springrts.com/mantis/view.php?id=6096

Overloading the callin like this is confusing, so I split the new meaning out into AllowUnitTargetRange. See:
- https://github.com/ZeroK-RTS/Zero-K/commit/1a38d8380ef6134c337838c00ba6d4c60a62f3b7
- https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaRules/gadgets.lua#L1343-L1377

Perhaps the split could happen engine-side.

Contributor guide

Open the contributing guide

Research direction

Start by reading the AllowWeaponTarget usage described in the issue and the linked Zero-K LuaRules/gadgets.lua section at lines 1343-1377, then compare the referenced commit. Determine the engine-side callin boundaries and confirm that target acquisition range no longer requires an overloaded targetID value. Done means the two meanings are exposed as separate callins without breaking the existing consumer.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, lua
Domain
api, game-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.