Commit b5189f7
authored
fix: sector event routing, type guards, and color field (#99)
* fix: pass side field through sector events to extension
- fnc_trackSectors: include str _newOwner (side) in captured events,
empty string for contested events
- fnc_handleCustomEvent: extract side string from eventMessage[2]
and pass it as a typed positional arg to :EVENT:SECTOR:
* docs: design for separating capturedFlag from :EVENT:SECTOR:
* fix: remove capturedFlag from :EVENT:SECTOR: routing
capturedFlag has player-centric fields (unitName, unitSide, flagSide)
incompatible with sector-centric fields (objectType, unitName, side,
position). Let it fall through to :EVENT:GENERAL: instead.
* fix: simplify side extraction in sector event routing
param [2, ""] already guarantees a string default, so the isEqualType
check was redundant.
* fix: add type guard for side extraction in sector events
param [2, ""] returns the raw value at index 2 even if it's an array
(position), not the default. Use param's type-check argument [2, "", [""]]
to ensure only strings are accepted as side, falling back to "" for
non-string values like position arrays at index 2.
* fix: update sector event comment and add type guards to all params
Document the full format [objectType, unitName, side, color, position]
and note that color is not captured by the extension. Add type guards
to params 0 and 1 for consistency.
* feat: capture color field from sector events
Extract color (index 3) from the event message array and send it to
the extension as part of the :EVENT:SECTOR: args. Format changes from
[frame, type, objectType, unitName, side, posX?, posY?, posZ?] to
[frame, type, objectType, unitName, side, color, posX?, posY?, posZ?].
* fix: restore sector example in comment, not flag capture
* fix: add empty color field to sector capture events
fnc_trackSectors sends [objectType, name, side, position] but the
extension now expects color between side and position. Add empty string
for color since sectors don't have a meaningful color value.
* chore: remove outdated design doc1 parent 2bc1b7f commit b5189f7
2 files changed
Lines changed: 13 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
0 commit comments