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

Apply new binary patch to Salem #6499

Merged
merged 5 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/snippets/features.6499.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- (#6499) Allow Footprint locking for (modded) units

With thanks to an assembly patch the footprint changes that were previously unique to the Cybran Tech 2 Destroyer can now be applied to any unit. For more details, see the pull request on GitHub.

Interested in how assembly patches work? Reach out to the game team. You can find us easiest via the official Discord server.
5 changes: 5 additions & 0 deletions changelog/snippets/fix.6499.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- (#6499) Fix hard crash when exiting the game when a Salem is on land

The Cybran Tech 2 Destroyer (Salem) has the special ability to move from water onto land. There was a bug in a special, alternative implementation introduced by FAForever. Together with an assembly patch this bug is now fixed.

Interested in how assembly patches work? Reach out to the game team. You can find us easiest via the official Discord server.
14 changes: 0 additions & 14 deletions engine/Patches.lua

This file was deleted.

6 changes: 5 additions & 1 deletion engine/Sim/Unit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ end
function Unit:EnableManipulators(bone, Enable)
end

---Forces game to use AltFootprint for the unit
---@param state boolean
function Unit:ForceAltFootPrint(state)
end

--- Returns the unit's multiplier to a damage type
---@param damageTypeName DamageType
---@return number
Expand Down Expand Up @@ -269,7 +274,6 @@ end
---@param statName string
---@param defaultVal? number
---@return number
-- Special case for the Salem: GetStat("h1_SetSalemAmph", 0 or 1) will Disable/Enable amphibious mode
function Unit:GetStat(statName, defaultVal)
end

Expand Down
4 changes: 2 additions & 2 deletions units/URS0201/URS0201_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ URS0201 = ClassUnit(CSeaUnit) {
CSeaUnit.OnScriptBitSet(self, bit)
if bit == 1 then
if self.Layer ~= 'Land' then
self:GetStat("h1_SetSalemAmph", 0)
self:ForceAltFootPrint(true)
else
self:SetScriptBit('RULEUTC_WeaponToggle', false)
end
Expand All @@ -183,7 +183,7 @@ URS0201 = ClassUnit(CSeaUnit) {
OnScriptBitClear = function(self, bit)
CSeaUnit.OnScriptBitClear(self, bit)
if bit == 1 then
self:GetStat("h1_SetSalemAmph", 1)
self:ForceAltFootPrint(false)
end
end,
}
Expand Down
7 changes: 7 additions & 0 deletions units/URS0201/URS0201_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ UnitBlueprint{
BuildCostMass = 2250,
BuildTime = 10000,
},
AltFootprint = -- water only
{
SizeX = 2,
SizeZ = 8,
OccupancyCaps = 8,
MinWaterDepth = 1.5,
},
Footprint = {
SizeX = 2,
SizeZ = 8,
Expand Down
Loading