Manually set a sector as unsafe - #6
StudentAlleg wants to merge 2 commits into
Conversation
…nd now also marks a sector as dangerous (red flashing). Updated pathfinding to update when this happens and send a notification if a miner was re-routed because of this.
cf3c690 to
93e87a6
Compare
| TrapHackBoot(pcluster); | ||
| pcluster->SetHighlight(pside->GetObjectID(), pfmHC->highlight); | ||
|
|
||
| //Xynth #208 What a drone says when the mark pushes it off the route it was flying. |
There was a problem hiding this comment.
not apart of Xynth's 208 changes
| pcluster->SetHighlight(pside->GetObjectID(), pfmHC->highlight); | ||
|
|
||
| //Xynth #208 What a drone says when the mark pushes it off the route it was flying. | ||
| //Swap this for whichever line fits best - the names are in src/Igc/sounds.h. |
There was a problem hiding this comment.
we are keeping, remove comment
| } | ||
|
|
||
| m_highlight = false; //Xynth #208 | ||
| for (SideID sid = 0; sid < c_cSidesMax; sid++) //Xynth #208 |
There was a problem hiding this comment.
🟡 Changes recommended
The server-side drone reroute/alert logic only compares the first hop and can miss drones whose route intersects the newly-dangerous sector later, which doesn’t fully match the PR’s stated behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a per-team “sector marking” system that supports cycling highlight states (none/important/danger), propagates the state over the network, and updates AI/pathing to prefer avoiding “danger” sectors while keeping client route rendering consistent with the AI’s actual routing behavior.
Changes:
- Replace the legacy boolean sector highlight with a per-side
ClusterHighlightstate (none/important/danger) and update message payloads/versioning accordingly. - Update minimap interaction/rendering to cycle and display highlight states (cyan for important, red for danger).
- Update routing utilities so AI (and route drawing) prefer to avoid sectors marked dangerous, falling back only when no other route exists.
File summaries
| File | Description |
|---|---|
| src/Wopr/AllegianceInterop/igcWrapper.h | Updates interop cluster highlight API to be per-side and multi-state. |
| src/Wopr/AllegianceInterop/igcWrapper.cpp | Wires interop wrapper calls through to the updated native interface. |
| src/Wopr/AllegianceInterop/AllMessages.h | Updates managed message wrapper to carry ClusterHighlight instead of bool. |
| src/WinTrek/sectormap.cpp | Cycles highlight state on ctrl-right-click and renders important/danger colors. |
| src/WinTrek/cmdview.cpp | Draws routes using the same “real route” search as AI (FindRouteList). |
| src/Inc/MessageVersion.h | Bumps MSGVER for the wire-format change to HIGHLIGHT_CLUSTER. |
| src/Inc/Messages.h | Changes CS_HIGHLIGHT_CLUSTER payload to ClusterHighlight. |
| src/Igc/shipIGC.h | Implements new IshipIGC::ReplanRoute() by delegating to GotoPlan. |
| src/Igc/igc.h | Introduces ClusterHighlight constants; updates interfaces and routing APIs; adds FindRouteList/FindRoute and GotoPlan::ReplanRoute. |
| src/Igc/common.cpp | Implements danger-avoidance in path search and adds FindRouteList/FindRoute. |
| src/Igc/clusterIGC.h | Stores highlight per side and updates IclusterIGC implementation accordingly. |
| src/Igc/clusterIGC.cpp | Initializes per-side highlight state on cluster initialize. |
| src/FedSrv/FedSrv.CPP | Validates highlight messages, applies marks server-side, and triggers drone replanning/alert logic. |
| src/clintlib/appmsg.cpp | Applies incoming highlight state for the local side and plays activation sound for any non-none mark. |
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (FindRoute(pshipDrone, pmodelPlan, pshipDrone->GetPilotType() < c_ptCarrier) == pwarpFlying) | ||
| continue; //Same first aleph: the route it is flying still stands |
|
|
||
| static bool IsFriendlyCluster(IclusterIGC* pcluster, IsideIGC* pside) | ||
| { | ||
| //Xynth #208 A sector the team has marked as dangerous is never friendly, whatever is |
| return rc; | ||
| } | ||
|
|
||
| //Xynth #208 A sector the side has marked dangerous is not routed through. Unlike |
| //marked dangerous - are preferences: a route that exists only through what they exclude | ||
| //still beats not going at all, which is what the caller asked for. They are given up in | ||
| //that order, because the danger mark is the deliberate one and cowardice is only a habit. | ||
| //Callers that draw a ship's route use this too, so the line drawn is the one flown. |
Marking a sector dangerous only replanned drones whose committed first aleph changed, so a drone whose route met the sector further along kept flying it and said nothing. Look at the whole route instead - the leg it is committed to, plus the search from where that leg comes out - and replan every drone whose route runs through the sector. The check has to run before the mark is applied, because afterwards the search keeps out of the sector and there is nothing left to recognise; clearing a mark is the mirror case and runs after. Also drop the //Xynth kgersen#208 tags from code that is not part of that change, remove the leftover note about swapping the reroute sound, and tighten the FindRouteList and sector-outline comments. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E6xUxh5QSWKV5rAJawfaUg
Manually sets a sector as unsafe. Drones will avoid pathing through these sectors if at all possible. When a sector is marked, all drones check to see if they were pathing through it. If so, they choose a new path and send an alert.