Extend 0-hp non-solid decorations edge case to allow building under things. fixes war1gus #220
This commit is contained in:
parent
b3b19b6aa8
commit
3dec8d3f74
1 changed files with 8 additions and 7 deletions
|
@ -650,17 +650,18 @@ void UpdateUnitStats(CUnitType &type, int reset)
|
|||
// Non-solid units can always be entered and they don't block anything
|
||||
if (type.BoolFlag[NONSOLID_INDEX].value) {
|
||||
if (type.Building) {
|
||||
type.MovementMask = MapFieldLandUnit |
|
||||
MapFieldSeaUnit |
|
||||
MapFieldBuilding |
|
||||
MapFieldCoastAllowed |
|
||||
MapFieldWaterAllowed |
|
||||
MapFieldNoBuilding |
|
||||
MapFieldUnpassable;
|
||||
if (type.BoolFlag[DECORATION_INDEX].value && type.MapDefaultStat.Variables[HP_INDEX].Max == 0) {
|
||||
// special case, a decoration with no HP can always be built over
|
||||
type.MovementMask = 0;
|
||||
type.FieldFlags = 0;
|
||||
} else {
|
||||
type.MovementMask = MapFieldLandUnit |
|
||||
MapFieldSeaUnit |
|
||||
MapFieldBuilding |
|
||||
MapFieldCoastAllowed |
|
||||
MapFieldWaterAllowed |
|
||||
MapFieldNoBuilding |
|
||||
MapFieldUnpassable;
|
||||
type.FieldFlags = MapFieldNoBuilding;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue