unify(pathfinder): Merge PathfindLayer::doDebugIcons(), Pathfinder::Classify functions, Pathfinder::checkDestination() and Pathfinder::checkForMovement()#2414
Conversation
|
| #if RTS_GENERALS && RETAIL_COMPATIBLE_PATHFINDING | ||
| cell->setType(PathfindCell::CELL_CLIFF); // it's off the bridge. | ||
| #else | ||
| cell->setType(PathfindCell::CELL_BRIDGE_IMPASSABLE); // it's off the bridge. |
There was a problem hiding this comment.
I wonder if another way to write this was doing CELL_BRIDGE_IMPASSABLE = CELL_CLIFF for CRC Generals.
There was a problem hiding this comment.
i will have a nother look at this, i didn't consider tweaking the struct
There was a problem hiding this comment.
Actually looking back at it, they swap between using CELL_CLIFF and CELL_IMPASSABLE for different parts of a bridge, while Zero Hour replaced them with just CELL_BRIDGE_IMPASSABLE
| // removing, so it's safer to just remove it, as by the time some units "die", they've become | ||
| // lifeless immobile husks of debris, but we still need to remove them. jba. | ||
|
|
||
| #if !RTS_GENERALS |
There was a problem hiding this comment.
If this involved KINDOF_BLAST_CRATER, they don't exist in generals so compiling without retail compatible in generals is invalid for this.
I left an issue about KindOfType, since the structures changed between generals and zero hour in a way that will make them incompatible. But it also depends on how these are used relative to data.
| return; | ||
| } | ||
|
|
||
| #if RTS_GENERALS |
| // removing, so it's safer to just remove it, as by the time some units "die", they've become | ||
| // lifeless immobile husks of debris, but we still need to remove them. jba. | ||
|
|
||
| #if !RTS_GENERALS |
| return; | ||
| } | ||
|
|
||
| #if RTS_GENERALS |
This PR merges the next block of functions.
PathfindLayer::doDebugIcons() inherits the Zero Hour implementation.
Pathfinder::classifyCells(), PathfindLayer::classifyLayerMapCell() and PathfindLayer::classifyWallMapCell() have small conditional cahnges that are required for Generals to not mismatch with retail.
Pathfinder::classifyFence, Pathfinder::classifyObjectFootprint and Pathfinder::internal_classifyObjectFootprint have heavy amounts of conditional compilation within them due to significant changes from Generals to Zero Hour.
Pathfinder::checkDesination() and Pathfinder::checkForMovement() only have smaller changes.
I stopped at this point as going further requires dragging in all of the rest of the merge worth of changes and would be too much in this one.
This PR can be squash merged