Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: GLA Buildings are missing Fortified Structures visuals during sell #885

Merged
merged 6 commits into from
Aug 14, 2022

Conversation

commy2
Copy link
Collaborator

@commy2 commy2 commented Aug 13, 2022

This change makes it so buildings with Fortified Structures upgrade do not lose their "visual fortifications" (sand bags, barbed wire etc.) while being sold.

This does not affect any damage taken.

Note that the fortifications will not be shown while the building is being constructed. However, the armor bonus from Fortified Structures does not apply while the building is being constructed either, so this is the desired behaviour.

@commy2 commy2 added Bug Something is not working right Minor Severity: Minor < Major < Critical < Blocker labels Aug 13, 2022
@xezon
Copy link
Collaborator

xezon commented Aug 14, 2022

This is huge change. Did you all write it by hand or did you copy from other places? It is not clear to me what level of attention this Review requires.

@commy2
Copy link
Collaborator Author

commy2 commented Aug 14, 2022

It was done by hand.

To every building with Fortified Structures I added this block:

expand
    ; Patch104p @bugfix 13/08/2022 Keep Fortified Structure visuals while selling the building.
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD
      Model              = xxxxxE
      Animation          = xxxxxE.xxxxxE
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD DAMAGED
      Model              = xxxxxE_D
      Animation          = xxxxxE_D.xxxxxE_D
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD REALLYDAMAGED
      Model              = xxxxxE_E
      Animation          = xxxxxE_E.xxxxxE_E
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD NIGHT
      Model              = xxxxxE_N
      Animation          = xxxxxE_N.xxxxxE_N
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD NIGHT DAMAGED
      Model              = xxxxxE_DN
      Animation          = xxxxxE_DN.xxxxxE_DN
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD NIGHT REALLYDAMAGED
      Model              = xxxxxE_EN
      Animation          = xxxxxE_EN.xxxxxE_EN
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD SNOW
      Model              = xxxxxE_S
      Animation          = xxxxxE_S.xxxxxE_S
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD SNOW DAMAGED
      Model              = xxxxxE_DS
      Animation          = xxxxxE_DS.xxxxxE_DS
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD SNOW REALLYDAMAGED
      Model              = xxxxxE_ES
      Animation          = xxxxxE_ES.xxxxxE_ES
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD NIGHT SNOW
      Model              = xxxxxE_NS
      Animation          = xxxxxE_NS.xxxxxE_NS
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD NIGHT SNOW DAMAGED
      Model              = xxxxxE_DNS
      Animation          = xxxxxE_DNS.xxxxxE_DNS
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End
    ConditionState       = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED GARRISONED SOLD NIGHT SNOW REALLYDAMAGED
      Model              = xxxxxE_ENS
      Animation          = xxxxxE_ENS.xxxxxE_ENS
      AnimationMode      = LOOP
      Flags              = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
    End

where xxxxx is replaced with the appropriate model.

If you test this, all you need to do is open the map with all buildings placed and sell with and without Fortifed Structures. If you want to be thorough, you have to damage them as well once slightly and once badly.

Every commit fixes one building type. The first one does all GLA Barracks (including fakes and GC_).

Copy link
Collaborator

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I skimmed through the lines and it appears to look ok.

@xezon xezon changed the title Fix: GLA Buildings Missing Fortified Structures Visuals While Selling Building Fix: GLA Buildings are missing Fortified Structures visuals during sell Aug 14, 2022
@xezon xezon merged commit e96c686 into main Aug 14, 2022
@xezon xezon deleted the fix-fortified-visuals-missing-when-sold branch August 14, 2022 12:32
@xezon xezon added the GLA Affects GLA faction label Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working right GLA Affects GLA faction Minor Severity: Minor < Major < Critical < Blocker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GLA Buildings with Fortified Structure upgrade have no appropriate model when sold
2 participants