Closed tnevolin closed 4 years ago
Full excerpt:
E.g. if a mine is added to a tile t
, then the items
field should be updated like this:
t.items = (t.items & !0x81E00050) | 0x10
Good catch! I made the erroneous assumption it was related to land/sea because that struct is split between the two for a lot of the other values. These values are all hardcoded into binary for rulesterraforming struct. I see now that they all translate to BIT* map enum. Corrected the misleading code and added more clarity in latest push.
These flags have nothing to do with land/sea. Instead they provide map items bits those need to be set and removed for given terraforming action to take place, correspondigly. Probably should rename them to reflect this and help others.
Although, to be honest, I am not entirely sure how they get distinguished between land/sea improvements. Probably by assuming that improvements have same flag on land and sea and that removed improvement are superset of incompatible land/sea improvements even if certain sea improvements are disables and never can be at sea.
https://github.com/b-casey/OpenSMACX/blob/53c114db88fa12f5261be3430c2495417ce6e517/src/terraforming.h#L57