Opened 12 years ago
Closed 12 years ago
#1574 closed enhancement (fixed)
[PATCH] Show shallows (walkable water) on minimap.
Reported by: | wraitii | Owned by: | wraitii |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 11 |
Component: | UI & Simulation | Keywords: | minimap shallows |
Cc: | Patch: |
Description
I couldn't find any post discussing why this wasn't in the game yet, so I assume it's because no-one put it in.
The attached patch reads the value from "pathfinder.xml" for maximum depth of passable water (assuming "default"), stores it and uses it to display shallow water in a lighter color, to clearly show where units can traverse and where they can't. It's neat on map such as the RM "Rivers".
Attachments (2)
Change History (7)
by , 12 years ago
Attachment: | shallowsOnMinimap.patch added |
---|
comment:1 by , 12 years ago
by , 12 years ago
Attachment: | shallowsOnMinimap.2.patch added |
---|
comment:2 by , 12 years ago
Changed the code to explicitly handle the case where there is no "default" passability class... I don't check for the existence of passability classes or the pathfinder file itself because I believe other things would break before.
This changes nothing, as "0" means "no shallows", but it makes it more explicit. (I commented include "ICmpTerritoryManager.h" to check if it was needed... It actually seems not to be, I forgot to remove it).
comment:3 by , 12 years ago
I think you can commit the patch, and indeed ICmpTerritoryManager
is never referenced in that file so just remove the include.
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Nice idea, it seems to work correctly. Looks like
ICmpTerritoryManager.h
got included twice by mistake inMiniMap.cpp
. You might want to use someENSURE
statements because you're relying on the existence of a "default" passability class with aMaxWaterDepth
element (CParamNode
s have anIsOk()
method for verifying the node exists). It looks like nothing awful will happen if they don't exist,ToFloat()
will return 0, but it would be a difficult bug to find.