Skip to content

Commit dbe57c8

Browse files
committed
Attempt to fix parsing of DropPodTrailer
1 parent fc4a19a commit dbe57c8

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/Ext/Rules/Body.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,9 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
198198
this->Promote_VeteranAnimation.Read(exINI, GameStrings::AudioVisual, "Promote.VeteranAnimation");
199199
this->Promote_EliteAnimation.Read(exINI, GameStrings::AudioVisual, "Promote.EliteAnimation");
200200

201-
Nullable<AnimTypeClass*> droppod_trailer {};
202-
droppod_trailer.Read(exINI, GameStrings::General, "DropPodTrailer");
203-
this->DropPodTrailer = droppod_trailer.Get(AnimTypeClass::Find("SMOKEY"));// Ares convention
201+
this->DropPodTrailer.Read(exINI, GameStrings::General, "DropPodTrailer");
204202
this->PodImage = FileSystem::LoadSHPFile("POD.SHP");
203+
this->DropPodDefaultTrailer = AnimTypeClass::Find("SMOKEY");
205204

206205
this->BuildingWaypoints.Read(exINI, GameStrings::General, "BuildingWaypoints");
207206

@@ -458,6 +457,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
458457
.Process(this->VisualScatter_Max)
459458
.Process(this->ShowDesignatorRange)
460459
.Process(this->DropPodTrailer)
460+
.Process(this->DropPodDefaultTrailer)
461461
.Process(this->PodImage)
462462
.Process(this->DamageOwnerMultiplier)
463463
.Process(this->DamageAlliesMultiplier)

src/Ext/Rules/Body.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ class RulesExt
160160
Valueable<bool> ShowDesignatorRange;
161161
Valueable<bool> IsVoiceCreatedGlobal;
162162
Valueable<int> SelectionFlashDuration;
163-
AnimTypeClass* DropPodTrailer;
163+
Nullable<AnimTypeClass*> DropPodTrailer;
164+
AnimTypeClass* DropPodDefaultTrailer;
164165
SHPStruct* PodImage;
165166
Valueable<bool> DrawInsignia_OnlyOnSelected;
166167
Valueable<Point2D> DrawInsignia_AdjustPos_Infantry;
@@ -352,6 +353,7 @@ class RulesExt
352353
, VisualScatter_Max { Leptons(32) }
353354
, ShowDesignatorRange { true }
354355
, DropPodTrailer { }
356+
, DropPodDefaultTrailer { }
355357
, PodImage { }
356358
, DamageOwnerMultiplier { 1.0 }
357359
, DamageAlliesMultiplier { 1.0 }

src/New/Type/Affiliated/DroppodTypeClass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ DEFINE_HOOK(0x4B5B70, DroppodLocomotionClass_ILoco_Process, 0x5)
9595

9696
if (timeSinceCreation % podType->Trailer_SpawnDelay == 1)
9797
{
98-
if (auto trailerType = podType->Trailer.Get(RulesExt::Global()->DropPodTrailer))
98+
if (auto trailerType = podType->Trailer.Get(RulesExt::Global()->DropPodTrailer.Get(RulesExt::Global()->DropPodDefaultTrailer)))
9999
{
100100
auto trailer = GameCreate<AnimClass>(trailerType, oldLoc);
101101
AnimExt::SetAnimOwnerHouseKind(trailer, pLinked->Owner, nullptr, false, true);

0 commit comments

Comments
 (0)