Skip to content

Commit 3b177b9

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into origin/ae-attach-discard-by-health-3
# Conflicts: # CREDITS.md # docs/Whats-New.md
2 parents d4c7e3c + b31b73b commit 3b177b9

20 files changed

+261
-41
lines changed

CREDITS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ This page lists all the individual contributions to the project by their author.
386386
- Separate the AirstrikeClass pointer between the attacker/aircraft and the target to avoid erroneous overwriting issues
387387
- Fix the bug that buildings will always be tinted as airstrike owner
388388
- Fix the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it
389+
- Fix the bug that infantry ignored `Passengers` and `SizeLimit` when entering buildings
389390
- **Apollo** - Translucent SHP drawing patches
390391
- **ststl**:
391392
- Customizable `ShowTimer` priority of superweapons
@@ -470,6 +471,8 @@ This page lists all the individual contributions to the project by their author.
470471
- Fire weapon when Warhead kills something
471472
- Promotion animation deglobalization
472473
- Forcing specific weapon by range
474+
- Passenger-based insignias
475+
- Use `InsigniaType` to set the properties of insignia in a batch
473476
- Attached effect attach/discard by health
474477
- Attached effect with `ExtraWarheads` and `FeedbackWeapon`
475478
- `AuxWeapon`

Phobos.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
<ClCompile Include="src\Misc\RetryDialog.cpp" />
8585
<ClCompile Include="src\New\Type\Affiliated\DroppodTypeClass.cpp" />
8686
<ClCompile Include="src\New\Type\DigitalDisplayTypeClass.cpp" />
87+
<ClCompile Include="src\New\Type\InsigniaTypeClass.cpp" />
8788
<ClCompile Include="src\New\Type\RadTypeClass.cpp" />
8889
<ClCompile Include="src\New\Type\SelectBoxTypeClass.cpp" />
8990
<ClCompile Include="src\New\Type\ShieldTypeClass.cpp" />
@@ -230,6 +231,7 @@
230231
<ClInclude Include="src\New\Type\Affiliated\TypeConvertGroup.h" />
231232
<ClInclude Include="src\New\Type\Affiliated\DroppodTypeClass.h" />
232233
<ClInclude Include="src\New\Type\DigitalDisplayTypeClass.h" />
234+
<ClInclude Include="src\New\Type\InsigniaTypeClass.h" />
233235
<ClInclude Include="src\New\Type\RadTypeClass.h" />
234236
<ClInclude Include="src\New\Type\SelectBoxTypeClass.h" />
235237
<ClInclude Include="src\New\Type\ShieldTypeClass.h" />

docs/Fixed-or-Improved-Logics.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
222222
- Fixed the bug that buildings will always be tinted as airstrike owner.
223223
- Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it.
224224
- Fixed the issue where computer players did not search for new enemies after defeating them or forming alliances with them.
225+
- Fixed the bug that infantry ignored `Passengers` and `SizeLimit` when entering buildings.
225226

226227
## Fixes / interactions with other extensions
227228

@@ -858,25 +859,31 @@ Image= ; name of the file that will be used as image, without exten
858859

859860
- You can now customize veterancy insignia of TechnoTypes.
860861
- `Insignia.(Rookie|Veteran|Elite)` can be used to set a custom insignia file, optionally for each veterancy stage. Like the original / default file, `pips.shp`, they are drawn using `palette.pal` as palette.
861-
- `InsigniaFrame.(Rookie|Veteran|Elite)` can be used to set (zero-based) frame index of the insignia to display, optionally for each veterancy stage. Using -1 uses the default setting. Default settings are -1 (none) for rookie, 14 for veteran and 15 for elite.
862-
- A shorthand `InsigniaFrames` can be used to list them in order from rookie, veteran and elite instead as well. `InsigniaFrame.(Rookie|Veteran|Elite)` takes priority over this.
863-
- Normal insignia can be overridden for specific weapon modes of `Gunner=true` units by setting `Insignia.(Frame/Frames).WeaponN` where `N` stands for 1-based weapon mode index. If not set, defaults to non-mode specific insignia settings.
862+
- `InsigniaFrame(.Rookie|Veteran|Elite)` can be used to set (zero-based) frame index of the insignia to display, optionally for each veterancy stage. Using -1 uses the default setting. Default settings are -1 (none) for rookie, 14 for veteran and 15 for elite.
863+
- A shorthand `InsigniaFrames` can be used to list them in order from rookie, veteran and elite instead as well. `InsigniaFrame(.Rookie|Veteran|Elite)` takes priority over this.
864+
- These settings will be overriden by the properties set in [InsigniaType](Miscellanous.md#insignia-type), if `InsigniaType` is set.
865+
- Normal insignia can be overridden for specific weapon modes of `Gunner=true` units by setting `Insignia(.Frame/.Frames).WeaponN` where `N` stands for 1-based weapon mode index. If not set, defaults to non-mode specific insignia settings.
866+
- These settings will be overriden by the properties set in [InsigniaType](Miscellanous.md#insignia-type), if `InsigniaType.WeaponN` is set.
867+
- Normal insignia can be overridden when its current passenger size reaches a certain amount by setting `Insignia(.Frame/.Frames).PassengersN` where `N` stands for the current passenger size amount (from 0 to `Passengers` of the transport). If not set, defaults to non-passenger specific insignia settings. Will be overridden by weapon mode insignia settings, if set.
868+
- These settings will be overriden by the properties set in [InsigniaType](Miscellanous.md#insignia-type), if `InsigniaType.PassengersN` is set.
864869
- `Insignia.ShowEnemy` controls whether or not the insignia is shown to enemy players. Defaults to `[General] -> EnemyInsignia`, which in turn defaults to true.
865870
- You can make insignias appear only on selected units using `DrawInsignia.OnlyOnSelected`.
866871
- Position for insignias can be adjusted by setting `DrawInsignia.AdjustPos.Infantry` for infantry, `DrawInsignia.AdjustPos.Buildings` for buildings, and `DrawInsignia.AdjustPos.Units` for others.
867872
- `DrawInsignia.AdjustPos.BuildingsAnchor` can be set to an anchor point to anchor the insignia position relative to the building's selection bracket. By default the insignia position is not anchored to the selection bracket.
873+
- `DrawInsignia.UsePixelSelectionBracketDelta` can be set to use techno's `PixelSelectionBracketDelta` to additionally adjust insignias vertically.
868874

869875
In `rulesmd.ini`:
870876
```ini
871877
[General]
872-
EnemyInsignia=true ; boolean
878+
EnemyInsignia=true ; boolean
873879

874880
[AudioVisual]
875-
DrawInsignia.OnlyOnSelected=false ; boolean
876-
DrawInsignia.AdjustPos.Infantry=5,2 ; X,Y, position offset from default
877-
DrawInsignia.AdjustPos.Units=10,6 ; X,Y, position offset from default
878-
DrawInsignia.AdjustPos.Buildings=10,6 ; X,Y, position offset from default
879-
DrawInsignia.AdjustPos.BuildingsAnchor= ; Hexagon vertex enumeration (top|lefttop|leftbottom|bottom|rightbottom|righttop)
881+
DrawInsignia.OnlyOnSelected=false ; boolean
882+
DrawInsignia.UsePixelSelectionBracketDelta=false ; boolean
883+
DrawInsignia.AdjustPos.Infantry=5,2 ; X,Y, position offset from default
884+
DrawInsignia.AdjustPos.Units=10,6 ; X,Y, position offset from default
885+
DrawInsignia.AdjustPos.Buildings=10,6 ; X,Y, position offset from default
886+
DrawInsignia.AdjustPos.BuildingsAnchor= ; Hexagon vertex enumeration (top|lefttop|leftbottom|bottom|rightbottom|righttop)
880887

881888
[SOMETECHNO] ; TechnoType
882889
Insignia= ; filename - excluding the .shp extension
@@ -897,6 +904,15 @@ InsigniaFrame.WeaponN.Rookie=-1 ; int, frame of insignia shp (zero-base
897904
InsigniaFrame.WeaponN.Veteran=-1 ; int, frame of insignia shp (zero-based) or -1 for default
898905
InsigniaFrame.WeaponN.Elite=-1 ; int, frame of insignia shp (zero-based) or -1 for default
899906
InsigniaFrames.WeaponN=-1,-1,-1 ; int, frames of insignia shp (zero-based) or -1 for default
907+
Insignia.PassengersN= ; filename - excluding the .shp extension
908+
Insignia.PassengersN.Rookie= ; filename - excluding the .shp extension
909+
Insignia.PassengersN.Veteran= ; filename - excluding the .shp extension
910+
Insignia.PassengersN.Elite= ; filename - excluding the .shp extension
911+
InsigniaFrame.PassengersN=-1 ; int, frame of insignia shp (zero-based) or -1 for default
912+
InsigniaFrame.PassengersN.Rookie=-1 ; int, frame of insignia shp (zero-based) or -1 for default
913+
InsigniaFrame.PassengersN.Veteran=-1 ; int, frame of insignia shp (zero-based) or -1 for default
914+
InsigniaFrame.PassengersN.Elite=-1 ; int, frame of insignia shp (zero-based) or -1 for default
915+
InsigniaFrames.PassengersN=-1,-1,-1 ; int, frames of insignia shp (zero-based) or -1 for default
900916
Insignia.ShowEnemy= ; boolean
901917
```
902918

docs/Miscellanous.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,31 @@ SaveVariablesOnScenarioEnd=false ; boolean
8585
Correspondingly, if such a writing method causes any errors, it is also not within the scope of responsibility of this function.
8686
```
8787

88+
### Insignia Type
89+
90+
- It is now possible to define the properties of insignia in an entity, so that all properties in it will be used once it's applied to a techno.
91+
92+
In `rulesmd.ini`:
93+
```ini
94+
[InsigniaTypes]
95+
0=SOMEINSIGNIATYPE
96+
97+
[SOMEINSIGNIATYPE] ; InsigniaType
98+
Insignia= ; filename - excluding the .shp extension
99+
Insignia.Rookie= ; filename - excluding the .shp extension
100+
Insignia.Veteran= ; filename - excluding the .shp extension
101+
Insignia.Elite= ; filename - excluding the .shp extension
102+
InsigniaFrame=-1 ; int, frame of insignia shp (zero-based) or -1 for default
103+
InsigniaFrame.Rookie=-1 ; int, frame of insignia shp (zero-based) or -1 for default
104+
InsigniaFrame.Veteran=-1 ; int, frame of insignia shp (zero-based) or -1 for default
105+
InsigniaFrame.Elite=-1 ; int, frame of insignia shp (zero-based) or -1 for default
106+
107+
[SOMETECHNO] ; TechnoType
108+
InsigniaType= ; InsigniaType
109+
InsigniaType.WeaponN= ; InsigniaType
110+
InsigniaType.PassengersN= ; InsigniaType
111+
```
112+
88113
## Game Speed
89114

90115
### Single player game speed

docs/Whats-New.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ New:
372372
- [Amphibious access vehicle](New-or-Enhanced-Logics.md#amphibious-access-vehicle) (by CrimRecya)
373373
- [Allow miners do area guard](Fixed-or-Improved-Logics.md#allow-miners-do-area-guard) (by TaranDahl)
374374
- [Make harvesters do addtional scan after unload](Fixed-or-Improved-Logics.md#make-harvesters-do-addtional-scan-after-unload) (by TaranDahl)
375+
- [Passenger-based insignias](Fixed-or-Improved-Logics.md#customizable-veterancy-insignias) (by Ollerus)
376+
- [Use `InsigniaType` to set the properties of insignia in a batch](Miscellanous.md#insignia-type) (by Ollerus)
375377
- Attached effect attach/discard by health (by Ollerus)
376378
- Attached effect with `ExtraWarheads` and `FeedbackWeapon` (by Ollerus)
377379
- [AuxWeapon](New-or-Enhanced-Logics.md#auxiliary-weapon) (by Ollerus)
@@ -393,6 +395,7 @@ Vanilla fixes:
393395
- Separated the AirstrikeClass pointer between the attacker/aircraft and the target to avoid erroneous overwriting issues (by NetsuNegi)
394396
- Fixed the bug that buildings will always be tinted as airstrike owner (by NetsuNegi)
395397
- Fixed the issue where computer players did not search for new enemies after defeating them or forming alliances with them (by FlyStar)
398+
- Fixed the bug that infantry ignored `Passengers` and `SizeLimit` when entering buildings (by NetsuNegi)
396399
397400
Phobos fixes:
398401
- Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi)

src/Ext/Building/Hooks.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,10 @@ DEFINE_HOOK(0x445D87, BuildingClass_Limbo_DestroyableObstacle, 0x6)
422422
if (pTypeExt->IsDestroyableObstacle)
423423
RecalculateCells<true>(pThis);
424424

425+
// only remove animation when the building is destroyed or sold
426+
if (pThis->Health > 0 && pThis->IsAlive && pThis->GetCurrentMission() != Mission::Selling)
427+
return 0;
428+
425429
for (auto& bAnim : pThis->Anims)
426430
{
427431
if (bAnim && VTable::Get(bAnim) == 0x7E3354)

src/Ext/Bullet/Body.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ void BulletExt::ExtData::InitializeLaserTrails()
154154
}
155155
}
156156

157-
void BulletExt::ExtData::ApplyExtraWarheads(std::vector<WarheadTypeClass*> exWH, std::vector<int> exWHDamageOverrides, std::vector<double> exWHChances, std::vector<bool> exWHFull, CoordStruct* coords, HouseClass* pOwner)
157+
void BulletExt::ExtData::ApplyExtraWarheads(const std::vector<WarheadTypeClass*>& exWH, const std::vector<int>& exWHDamageOverrides, const std::vector<double>& exWHChances, const std::vector<bool>& exWHFull, const CoordStruct& coords, HouseClass* pOwner)
158158
{
159159
auto const pThis = this->OwnerObject();
160160
int damage = pThis->WeaponType ? pThis->WeaponType->Damage : 0;
@@ -189,9 +189,9 @@ void BulletExt::ExtData::ApplyExtraWarheads(std::vector<WarheadTypeClass*> exWH,
189189
continue;
190190

191191
if (isFull)
192-
WarheadTypeExt::DetonateAt(pWH, *coords, pThis->Owner, damage, pOwner, pThis->Target);
192+
WarheadTypeExt::DetonateAt(pWH, coords, pThis->Owner, damage, pOwner, pThis->Target);
193193
else
194-
WarheadTypeExt::ExtMap.Find(pWH)->DamageAreaWithTarget(*coords, damage, pThis->Owner, pWH, true, pOwner, abstract_cast<TechnoClass*>(pThis->Target));
194+
WarheadTypeExt::ExtMap.Find(pWH)->DamageAreaWithTarget(coords, damage, pThis->Owner, pWH, true, pOwner, abstract_cast<TechnoClass*>(pThis->Target));
195195
}
196196
}
197197

src/Ext/Bullet/Body.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class BulletExt
5454
void InterceptBullet(TechnoClass* pSource, WeaponTypeClass* pWeapon);
5555
void ApplyRadiationToCell(CellStruct Cell, int Spread, int RadLevel);
5656
void InitializeLaserTrails();
57-
void ApplyExtraWarheads(std::vector<WarheadTypeClass*> exWH, std::vector<int> exWHDamageOverrides, std::vector<double> exWHChances, std::vector<bool> exWHFull, CoordStruct* coords, HouseClass* pOwner);
57+
void ApplyExtraWarheads(const std::vector<WarheadTypeClass*>& exWH, const std::vector<int>& exWHDamageOverrides, const std::vector<double>& exWHChances, const std::vector<bool>& exWHFull, const CoordStruct& coords, HouseClass* pOwner);
5858

5959
private:
6060
template <typename T>

src/Ext/Bullet/Hooks.DetonateLogics.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ DEFINE_HOOK(0x469AA4, BulletClass_Logics_Extras, 0x5)
304304
if (pThis->WeaponType)
305305
{
306306
auto const pWeaponExt = WeaponTypeExt::ExtMap.Find(pThis->WeaponType);
307-
pBulletExt->ApplyExtraWarheads(pWeaponExt->ExtraWarheads, pWeaponExt->ExtraWarheads_DamageOverrides, pWeaponExt->ExtraWarheads_DetonationChances, pWeaponExt->ExtraWarheads_FullDetonation, coords, pOwner);
307+
pBulletExt->ApplyExtraWarheads(pWeaponExt->ExtraWarheads, pWeaponExt->ExtraWarheads_DamageOverrides, pWeaponExt->ExtraWarheads_DetonationChances, pWeaponExt->ExtraWarheads_FullDetonation, *coords, pOwner);
308308
}
309309

310310
if (pThis->Owner)
@@ -318,7 +318,7 @@ DEFINE_HOOK(0x469AA4, BulletClass_Logics_Extras, 0x5)
318318
auto const pType = pAE->GetType();
319319

320320
if (pType->ExtraWarheads.size() > 0)
321-
pBulletExt->ApplyExtraWarheads(pType->ExtraWarheads, pType->ExtraWarheads_DamageOverrides, pType->ExtraWarheads_DetonationChances, pType->ExtraWarheads_FullDetonation, coords, pOwner);
321+
pBulletExt->ApplyExtraWarheads(pType->ExtraWarheads, pType->ExtraWarheads_DamageOverrides, pType->ExtraWarheads_DetonationChances, pType->ExtraWarheads_FullDetonation, *coords, pOwner);
322322
}
323323
}
324324
}
@@ -338,7 +338,6 @@ DEFINE_HOOK(0x469AA4, BulletClass_Logics_Extras, 0x5)
338338
if (BulletClass* pBullet = pWeapon->Projectile->CreateBullet(pThis->Owner, pThis->Owner,
339339
damage, pWeapon->Warhead, pWeapon->Speed, pWeapon->Bright))
340340
{
341-
pBullet->SetWeaponType(pWeapon);
342341
BulletExt::SimulatedFiringUnlimbo(pBullet, pThis->Owner->Owner, pWeapon, pThis->Location, true);
343342
BulletExt::SimulatedFiringEffects(pBullet, pThis->Owner->Owner, nullptr, false, true);
344343
}

src/Ext/Rules/Body.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <New/Type/LaserTrailTypeClass.h>
1010
#include <New/Type/DigitalDisplayTypeClass.h>
1111
#include <New/Type/AttachEffectTypeClass.h>
12+
#include <New/Type/InsigniaTypeClass.h>
1213
#include <New/Type/SelectBoxTypeClass.h>
1314
#include <Utilities/Patch.h>
1415

@@ -37,6 +38,7 @@ void RulesExt::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
3738
ShieldTypeClass::LoadFromINIList(pINI);
3839
LaserTrailTypeClass::LoadFromINIList(&CCINIClass::INI_Art);
3940
AttachEffectTypeClass::LoadFromINIList(pINI);
41+
InsigniaTypeClass::LoadFromINIList(pINI);
4042

4143
Data->LoadBeforeTypeData(pThis, pINI);
4244
}
@@ -187,6 +189,7 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
187189
this->DrawInsignia_AdjustPos_Buildings.Read(exINI, GameStrings::AudioVisual, "DrawInsignia.AdjustPos.Buildings");
188190
this->DrawInsignia_AdjustPos_BuildingsAnchor.Read(exINI, GameStrings::AudioVisual, "DrawInsignia.AdjustPos.BuildingsAnchor");
189191
this->DrawInsignia_AdjustPos_Units.Read(exINI, GameStrings::AudioVisual, "DrawInsignia.AdjustPos.Units");
192+
this->DrawInsignia_UsePixelSelectionBracketDelta.Read(exINI, GameStrings::AudioVisual, "DrawInsignia.UsePixelSelectionBracketDelta");
190193
this->Promote_VeteranAnimation.Read(exINI, GameStrings::AudioVisual, "Promote.VeteranAnimation");
191194
this->Promote_EliteAnimation.Read(exINI, GameStrings::AudioVisual, "Promote.EliteAnimation");
192195

@@ -429,6 +432,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
429432
.Process(this->DrawInsignia_AdjustPos_Buildings)
430433
.Process(this->DrawInsignia_AdjustPos_BuildingsAnchor)
431434
.Process(this->DrawInsignia_AdjustPos_Units)
435+
.Process(this->DrawInsignia_UsePixelSelectionBracketDelta)
432436
.Process(this->Promote_VeteranAnimation)
433437
.Process(this->Promote_EliteAnimation)
434438
.Process(this->AnimRemapDefaultColorScheme)

src/Ext/Rules/Body.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ class RulesExt
162162
Valueable<Point2D> DrawInsignia_AdjustPos_Buildings;
163163
Nullable<BuildingSelectBracketPosition> DrawInsignia_AdjustPos_BuildingsAnchor;
164164
Valueable<Point2D> DrawInsignia_AdjustPos_Units;
165+
Valueable<bool> DrawInsignia_UsePixelSelectionBracketDelta;
165166
Valueable<AnimTypeClass*> Promote_VeteranAnimation;
166167
Valueable<AnimTypeClass*> Promote_EliteAnimation;
167168

@@ -324,6 +325,7 @@ class RulesExt
324325
, DrawInsignia_AdjustPos_Buildings { { 10, 6 } }
325326
, DrawInsignia_AdjustPos_BuildingsAnchor {}
326327
, DrawInsignia_AdjustPos_Units { { 10, 6 } }
328+
, DrawInsignia_UsePixelSelectionBracketDelta { { false } }
327329
, Promote_VeteranAnimation {}
328330
, Promote_EliteAnimation {}
329331
, AnimRemapDefaultColorScheme { 0 }
@@ -381,7 +383,7 @@ class RulesExt
381383
, ProneSpeed_NoCrawls { 1.5 }
382384

383385
, DamagedSpeed { 0.75 }
384-
386+
385387
, HarvesterScanAfterUnload { false }
386388
{ }
387389

src/Ext/Techno/Body.Visuals.cpp

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,29 @@ void TechnoExt::DrawInsignia(TechnoClass* pThis, Point2D* pLocation, RectangleSt
134134
int insigniaFrame = insigniaFrames.X;
135135
int frameIndex = pTechnoTypeExt->InsigniaFrame.Get(pThis);
136136

137+
if (pTechnoType->Passengers > 0)
138+
{
139+
int passengersIndex = pTechnoTypeExt->Passengers_BySize ? pThis->Passengers.GetTotalSize() : pThis->Passengers.NumPassengers;
140+
passengersIndex = Math::min(passengersIndex, pTechnoType->Passengers);
141+
142+
if (auto const pCustomShapeFile = pTechnoTypeExt->Insignia_Passengers[passengersIndex].Get(pThis))
143+
{
144+
pShapeFile = pCustomShapeFile;
145+
defaultFrameIndex = 0;
146+
isCustomInsignia = true;
147+
}
148+
149+
int frame = pTechnoTypeExt->InsigniaFrame_Passengers[passengersIndex].Get(pThis);
150+
151+
if (frame != -1)
152+
frameIndex = frame;
153+
154+
auto const& frames = pTechnoTypeExt->InsigniaFrames_Passengers[passengersIndex];
155+
156+
if (frames != Vector3D<int>(-1, -1, -1))
157+
insigniaFrames = frames.Get();
158+
}
159+
137160
if (pTechnoType->Gunner)
138161
{
139162
int weaponIndex = pThis->CurrentWeaponNumber;
@@ -150,10 +173,10 @@ void TechnoExt::DrawInsignia(TechnoClass* pThis, Point2D* pLocation, RectangleSt
150173
if (frame != -1)
151174
frameIndex = frame;
152175

153-
auto& frames = pTechnoTypeExt->InsigniaFrames_Weapon[weaponIndex];
176+
auto const& frames = pTechnoTypeExt->InsigniaFrames_Weapon[weaponIndex];
154177

155178
if (frames != Vector3D<int>(-1, -1, -1))
156-
insigniaFrames = frames;
179+
insigniaFrames = frames.Get();
157180
}
158181

159182
if (pVeterancy->IsVeteran())
@@ -190,6 +213,8 @@ void TechnoExt::DrawInsignia(TechnoClass* pThis, Point2D* pLocation, RectangleSt
190213
break;
191214
}
192215

216+
offset.Y += RulesExt::Global()->DrawInsignia_UsePixelSelectionBracketDelta ? pThis->GetTechnoType()->PixelSelectionBracketDelta : 0;
217+
193218
DSurface::Temp->DrawSHP(
194219
FileSystem::PALETTE_PAL, pShapeFile, frameIndex, &offset, pBounds, BlitterFlags(0xE00), 0, -2, ZGradient::Ground, 1000, 0, 0, 0, 0, 0);
195220
}

0 commit comments

Comments
 (0)