DeployFire supports buildings#2104
Open
Fly-Star-him wants to merge 16 commits intoPhobos-developers:developfrom
Open
DeployFire supports buildings#2104Fly-Star-him wants to merge 16 commits intoPhobos-developers:developfrom
Fly-Star-him wants to merge 16 commits intoPhobos-developers:developfrom
Conversation
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
TaranDahl
requested changes
Feb 14, 2026
src/Ext/Building/Hooks.Unload.cpp
Outdated
|
|
||
| auto const pTypeExt = BuildingTypeExt::ExtMap.Find(pType); | ||
| const int result = pTypeExt->DeployFireDelay.isset() ? | ||
| pTypeExt->DeployFireDelay : (ScenarioClass::Instance->Random.RandomRanged(0, 2) + 14); |
Contributor
There was a problem hiding this comment.
The default value should be RearmTimer.TimeLeft.
In addition, the Nullable template should be used like this: nullableVar.Get(default).
src/Ext/Building/Hooks.Unload.cpp
Outdated
Comment on lines
73
to
74
| pThis->QueueMission(Mission::Guard, false); | ||
| pThis->NextMission(); |
Comment on lines
103
to
117
| const auto pBuilding = static_cast<BuildingClass*>(pObject); | ||
| auto const pType = pBuilding->Type; | ||
| const auto pHouse = pBuilding->Owner; | ||
|
|
||
| if (!pHouse->IsControlledByCurrentPlayer() || !pType->DeployFire || pType->Factory != AbstractType::None) | ||
| continue; | ||
|
|
||
| const Mission currentMission = pBuilding->CurrentMission; | ||
|
|
||
| if (currentMission == Mission::Construction || currentMission == Mission::Selling) | ||
| continue; | ||
|
|
||
| if (pBuilding->EMPLockRemaining > 0 || !pBuilding->WasOnline || pBuilding->BunkerLinkedItem) | ||
| continue; | ||
|
|
Contributor
There was a problem hiding this comment.
Should be wrapped into a function.
Comment on lines
+899
to
+900
| pBuilding->QueueMission(Mission::Guard, false); | ||
| pBuilding->NextMission(); |
| - Fix an issue where mining vehicles could not move after leaving a tank bunker | ||
| - Fixed the bug in AI scripts 56 and 57 that forced the launch of superweapons with index numbers 3 and 4 | ||
| - DeployFire supports buildings | ||
| - Fixed an issue where `OmniFire` was ineffective on buildings with `Turret=yes` |
Contributor
There was a problem hiding this comment.
OmniFire is actually a tag limited to UnitClass. AircraftClass uses Fighter, BuildingClass must face the target to fire, while InfantryClass ignores the facing.
Comment on lines
+60
to
+61
| pThis->QueueMission(Mission::Guard, false); | ||
| pThis->NextMission(); |
add link, correct the comment format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OmniFirewas ineffective on buildings withTurret=yes.Primarycould cause it to enter an unload state.DeployFireandDeployFireWeapon.Factory,GapGenerator, orPassengers, it will prioritize executing those deployment actions instead.DeployFireDelayspecifies the frame interval at which deployed weapons attempt to fire. If the weapon is unavailable due toROF,CanTarget, or other reasons, the deployed weapon will not fire.In
rulesmd.ini: