Skip to content

Commit 4a2c374

Browse files
committed
Merge v0.3.0.1 changes
1 parent c3919ca commit 4a2c374

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1202
-286
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ This page lists all the individual contributions to the project by their author.
162162
- Exploding unit passenger killing customization
163163
- Railgun particle target coordinate fix
164164
- Building target coordinate offset fix
165+
- Additional sync logging
165166
- **Morton (MortonPL)**:
166167
- `XDrawOffset`
167168
- Shield passthrough & absorption

Phobos.vcxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@
123123
<ClCompile Include="src\Utilities\Constructs.cpp" />
124124
<ClCompile Include="src\Utilities\EnumFunctions.cpp" />
125125
<ClCompile Include="src\Utilities\GeneralUtils.cpp" />
126-
<ClCompile Include="src\Ext\Techno\Hooks.VehicleToBuildingMCFix.cpp" />
126+
<ClCompile Include="src\Ext\Techno\Hooks.DeploysInto.cpp" />
127+
<ClCompile Include="src\Misc\SyncLogging.cpp" />
127128
<ClCompile Include="YRpp\StaticInits.cpp" />
128129
<ClCompile Include="src\Utilities\Patch.cpp" />
129130
</ItemGroup>
@@ -149,6 +150,7 @@
149150
<ClInclude Include="src\Misc\CaptureManager.h" />
150151
<ClInclude Include="src\Misc\FlyingStrings.h" />
151152
<ClInclude Include="src\Misc\PhobosToolTip.h" />
153+
<ClInclude Include="src\Misc\SyncLogging.h" />
152154
<ClInclude Include="src\New\Entity\ShieldClass.h" />
153155
<ClInclude Include="src\New\Type\RadTypeClass.h" />
154156
<ClInclude Include="src\New\Type\ShieldTypeClass.h" />

YRpp

Submodule YRpp updated 168 files

docs/Fixed-or-Improved-Logics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
7575
![Waving trees](_static/images/tree-shake.gif)
7676
*Animated trees used in [Ion Shock](https://www.moddb.com/mods/tiberian-war-ionshock)*
7777

78-
- `IsAnimated`, `AnimationRate` and `AnimationProbability` now work on TerrainTypes without `SpawnsTiberium` set to true.
78+
- `IsAnimated`, `AnimationRate` and `AnimationProbability` now work on TerrainTypes without `SpawnsTiberium` set to true. Note that this might impact performance.
7979
- Fixed transports recursively put into each other not having a correct killer set after second transport when being killed by something.
8080

8181
![image](_static/images/translucency-fix.png)
@@ -94,7 +94,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
9494

9595
- `Weapon` can be set to a WeaponType, to create a projectile and immediately detonate it instead of simply dealing `Damage` by `Warhead`. This allows weapon effects to be applied.
9696
- `Damage.Delay` determines delay between two applications of `Damage`. Requires `Damage` to be set to 1.0 or above. Value of 0 disables the delay. Keep in mind that this is measured in animation frames, not game frames. Depending on `Rate`, animation may or may not advance animation frames on every game frame.
97-
- `Damage.DealtByInvoker`, if set to true, makes any `Damage` dealt to be considered as coming from the animation's invoker (f.ex, firer of the weapon if it is Warhead `AnimList/SplashList` animation, the destroyed vehicle if it is `DestroyAnim` animation or the object the animation is attached to). Does not affect which house the `Damage` dealt by `Warhead` is dealt by.
97+
- `Damage.DealtByInvoker`, if set to true, makes any `Damage` dealt to be considered as coming from the animation's invoker (f.ex, firer of the weapon if it is Warhead `AnimList/SplashList` animation, the destroyed vehicle if it is `DestroyAnim` animation or the object the animation is attached to). If invoker has died or does not exist, the house the invoker belonged to is still used to deal damage and apply Phobos-introduced Warhead effects. Does not affect which house the `Damage` dealt by `Warhead` is dealt by.
9898
- `Damage.ApplyOncePerLoop`, if set to true, makes `Damage` be dealt only once per animation loop (on single loop animations, only once, period) instead of on every frame or intervals defined by `Damage.Delay`. The frame on which it is dealt is determined by `Damage.Delay`, defaulting to after the first animation frame.
9999

100100
In `artmd.ini`:

docs/Miscellanous.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This page describes every change in Phobos that wasn't categorized into a proper category yet.
44

5+
- Phobos writes additional information to the `SYNC#.txt` log files when a desynchronization occurs such as calls to random number generator functions, facing / target / destination changes etc.
6+
57
## Developer tools
68

79
### Dump Object Info

docs/New-or-Enhanced-Logics.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ Shield.InheritStateOnReplace=false ; boolean
227227
- `CreateUnit.RemapAnim`, if set to true, will cause the animation to be drawn in unit palette and remappable to owner's team color.
228228
- `CreateUnit.Mission` determines the initial mission of the created VehicleType.
229229
- `CreateUnit.Facing` determines the initial facing of created VehicleType.
230-
- `CreateUnit.RandomFacing`, if set to true makes it so that a random facing is picked instead.
231-
- `CreateUnit.InheritFacings` and `CreateUnit.InheritTurretFacings` inherit facings for vehicle body and turret respectively from the destroyed vehicle if the animation is a vehicle destroy animation.
232-
- `CreateUnit.ConsiderPathfinding`, if set to true, will consider whether or not the cell where the animation is located is occupied by other objects or impassable to the vehicle being created and will attempt to find a nearby cell that is not. Otherwise the vehicle will be created at the animation's location despite these obstacles.
230+
- `CreateUnit.RandomFacing`, if set to true, makes it so that a random facing is picked instead.
231+
- `CreateUnit.InheritFacings` and `CreateUnit.InheritTurretFacings` inherit facings for vehicle body and turret respectively from the destroyed vehicle if the animation is a vehicle destroy animation. `InheritTurretFacings` does not work with jumpjet vehicles due to technical constraints.
232+
- `CreateUnit.ConsiderPathfinding`, if set to true, will consider whether or not the cell where the animation is located is occupied by other objects or impassable to the vehicle being created and will attempt to find a nearby cell that is not. Otherwise the vehicle will be created at the animation's location despite these obstacles if possible.
233233

234234
In `artmd.ini`:
235235
```ini
@@ -618,10 +618,9 @@ Both `InitialStrength` and `InitialStrength.Cloning` never surpass the type's `S
618618
If this option is not set, the self-destruction logic will not be enabled.
619619
```{note}
620620
Please notice that if the object is a unit which carries passengers, they will not be released even with the `kill` option. This might change in the future if necessary.
621-
622-
If the object enters transport, the countdown will continue, but it will not self-destruct inside the transport.
623621
```
624622

623+
This logic also supports buildings delivered by [LimboDelivery](#LimboDelivery)
625624

626625
In `rulesmd.ini`:
627626
```ini

docs/Whats-New.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,33 @@ You can use the migration utility (can be found on [Phobos supplementaries repo]
237237

238238
## Changelog
239239

240+
### 0.3.0.1
241+
242+
New:
243+
- Additional sync logging in case of desync errors occuring (by Starkku)
244+
245+
Phobos fixes:
246+
- `AutoDeath` support for objects in limbo (by Trsdy)
247+
- Buildings sold by `AutoDeath` no longer play a click sound effect (by Trsdy)
248+
- Fixed shield animation being hidden while underground or in tunnels fix not working correctly (by Starkku)
249+
- Restore the `MindClearedSound` when deploying a mind-controlled unit into a building loses the mind-control (by Trsdy)
250+
- Fixed `RadSiteWarhead.Detonate` not detonating precisely on the affected object (thus requiring `CellSpread`) (by Starkku)
251+
- Fixed script action 10103 'Load Into Transports' unintentionally skipping next action (by FS-21)
252+
- Changed mission retry dialog button order to better match old order people are used to (by Trsdy)
253+
- Allow PowerPlant Enhancer to be affected by EMP (by Trsdy)
254+
- Animation `Weapon` with `Damage.DealtByInvoker=true` now uses the invoker's house to deal damage and apply Phobos warhead effects even if invoker is dead when weapon is fired (by Starkku)
255+
- Fixed a crash when trying to create radiation outside map bounds (by Otamaa)
256+
- Fixed new AI attack scripts not allowing zero damage weapons to pick targets (by Starkku)
257+
- Fixed floating point value parsing precision to match the game (by Starkku)
258+
- Power output / drain should now correctly be applied for buildings created via `LimboDelivery` in campaigns (by Starkku)
259+
- Fixed shield health bar showing empty bar when shield is still on very low health instead of depleted (by Starkku)
260+
- Fixed `CanTarget` not considering objects on bridges when checking if cell is empty (by Starkku)
261+
- Fixed vehicle deploy weapons not working if the unit is cloaked and weapon has `DecloakToFire=true` (by NetsuNegi & Starkku)
262+
- Fixed `IsAnimated` terrain not updating correctly in all circumstances (by Starkku)
263+
- Fixed `CreateUnit` interaction with bridges (spawning under when shouldn't etc) (by Starkku)
264+
- `CanTarget` now considers bridges as land like game's normal weapon selection does (by Starkku)
265+
- `AreaFire.Target` now takes cells with bridges into consideration depending on firer's elevation (by Starkku)
266+
240267
### 0.3
241268

242269
<details>

src/Commands/ObjectInfo.cpp

Lines changed: 9 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -50,81 +50,6 @@ void ObjectInfoCommandClass::Execute(WWKey eInput) const
5050
strcat_s(buffer, Phobos::readBuffer);
5151
};
5252

53-
auto getMissionName = [](int mID)
54-
{
55-
switch (mID)
56-
{
57-
case -1:
58-
return "None";
59-
case 0:
60-
return "Sleep";
61-
case 1:
62-
return "Attack";
63-
case 2:
64-
return "Move";
65-
case 3:
66-
return "QMove";
67-
case 4:
68-
return "Retreat";
69-
case 5:
70-
return "Guard";
71-
case 6:
72-
return "Sticky";
73-
case 7:
74-
return "Enter";
75-
case 8:
76-
return "Capture";
77-
case 9:
78-
return "Eaten";
79-
case 10:
80-
return "Harvest";
81-
case 11:
82-
return "Area_Guard";
83-
case 12:
84-
return "Return";
85-
case 13:
86-
return "Stop";
87-
case 14:
88-
return "Ambush";
89-
case 15:
90-
return "Hunt";
91-
case 16:
92-
return "Unload";
93-
case 17:
94-
return "Sabotage";
95-
case 18:
96-
return "Construction";
97-
case 19:
98-
return "Selling";
99-
case 20:
100-
return "Repair";
101-
case 21:
102-
return "Rescue";
103-
case 22:
104-
return "Missile";
105-
case 23:
106-
return "Harmless";
107-
case 24:
108-
return "Open";
109-
case 25:
110-
return "Patrol";
111-
case 26:
112-
return "ParadropApproach";
113-
case 27:
114-
return "ParadropOverfly";
115-
case 28:
116-
return "Wait";
117-
case 29:
118-
return "AttackMove";
119-
case 30:
120-
return "SpyplaneApproach";
121-
case 31:
122-
return "SpyplaneOverfly";
123-
default:
124-
return "INVALID_MISSION";
125-
}
126-
};
127-
12853
auto display = [&buffer]()
12954
{
13055
memset(Phobos::wideBuffer, 0, sizeof Phobos::wideBuffer);
@@ -134,14 +59,14 @@ void ObjectInfoCommandClass::Execute(WWKey eInput) const
13459
buffer[0] = 0;
13560
};
13661

137-
auto printFoots = [&append, &display, &getMissionName](FootClass* pFoot)
62+
auto printFoots = [&append, &display](FootClass* pFoot)
13863
{
13964
append("[Phobos] Dump ObjectInfo runs.\n");
14065
auto pType = pFoot->GetTechnoType();
14166
append("ID = %s, ", pType->ID);
14267
append("Owner = %s (%s), ", pFoot->Owner->get_ID(), pFoot->Owner->PlainName);
14368
append("Location = (%d, %d), ", pFoot->GetMapCoords().X, pFoot->GetMapCoords().Y);
144-
append("Current Mission = %d (%s)\n", pFoot->CurrentMission, getMissionName((int)pFoot->CurrentMission));
69+
append("Current Mission = %d (%s)\n", pFoot->CurrentMission, MissionControlClass::FindName(pFoot->CurrentMission));
14570

14671
if (pFoot->BelongsToATeam())
14772
{
@@ -177,12 +102,10 @@ void ObjectInfoCommandClass::Execute(WWKey eInput) const
177102

178103
if (pFoot->Passengers.NumPassengers > 0)
179104
{
180-
append("Passengers: %s", pFoot->Passengers.FirstPassenger->GetTechnoType()->ID);
181-
for (NextObject j(pFoot->Passengers.FirstPassenger->NextObject); j && abstract_cast<FootClass*>(*j); ++j)
182-
{
183-
auto passenger = static_cast<FootClass*>(*j);
184-
append(", %s", passenger->GetTechnoType()->ID);
185-
}
105+
FootClass* pCurrent = pFoot->Passengers.FirstPassenger;
106+
append("%d Passengers: %s", pFoot->Passengers.NumPassengers, pCurrent->GetTechnoType()->ID);
107+
for (pCurrent = abstract_cast<FootClass*>(pCurrent->NextObject); pCurrent; pCurrent = abstract_cast<FootClass*>(pCurrent->NextObject))
108+
append(", %s", pCurrent->GetTechnoType()->ID);
186109
append("\n");
187110
}
188111

@@ -210,7 +133,7 @@ void ObjectInfoCommandClass::Execute(WWKey eInput) const
210133
auto printBuilding = [&append, &display](BuildingClass* pBuilding)
211134
{
212135
append("[Phobos] Dump ObjectInfo runs.\n");
213-
auto pType = pBuilding->GetTechnoType();
136+
auto pType = pBuilding->Type;
214137
append("ID = %s, ", pType->ID);
215138
append("Owner = %s (%s), ", pBuilding->Owner->get_ID(), pBuilding->Owner->PlainName);
216139
append("Location = (%d, %d)\n", pBuilding->GetMapCoords().X, pBuilding->GetMapCoords().Y);
@@ -263,10 +186,10 @@ void ObjectInfoCommandClass::Execute(WWKey eInput) const
263186
case AbstractType::Infantry:
264187
case AbstractType::Unit:
265188
case AbstractType::Aircraft:
266-
printFoots(abstract_cast<FootClass*>(pObject));
189+
printFoots(static_cast<FootClass*>(pObject));
267190
break;
268191
case AbstractType::Building:
269-
printBuilding(abstract_cast<BuildingClass*>(pObject));
192+
printBuilding(static_cast<BuildingClass*>(pObject));
270193
break;
271194
default:
272195
append("INVALID ITEM!");

src/Commands/QuickSave.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "QuickSave.h"
2-
2+
#include <GameStrings.h>
33
#include <ScenarioClass.h>
44
#include <HouseClass.h>
55
#include <SessionClass.h>
@@ -47,7 +47,7 @@ void QuickSaveCommandClass::Execute(WWKey eInput) const
4747
_snprintf_s(fName, 0x7F, "Map.%04u%02u%02u-%02u%02u%02u-%05u.sav",
4848
time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond, time.wMilliseconds);
4949

50-
PrintMessage(StringTable::LoadString("TXT_SAVING_GAME"));
50+
PrintMessage(StringTable::LoadString(GameStrings::TXT_SAVING_GAME));
5151

5252
wchar_t fDescription[0x80] = { 0 };
5353
if (SessionClass::Instance->GameMode == GameMode::Campaign)
@@ -58,9 +58,9 @@ void QuickSaveCommandClass::Execute(WWKey eInput) const
5858
wcscat_s(fDescription, GeneralUtils::LoadStringUnlessMissing("TXT_QUICKSAVE_SUFFIX", L"Quicksaved"));
5959

6060
if (ScenarioClass::SaveGame(fName, fDescription))
61-
PrintMessage(StringTable::LoadString("TXT_GAME_WAS_SAVED"));
61+
PrintMessage(StringTable::LoadString(GameStrings::TXT_GAME_WAS_SAVED));
6262
else
63-
PrintMessage(StringTable::LoadString("TXT_ERROR_SAVING_GAME"));
63+
PrintMessage(StringTable::LoadString(GameStrings::TXT_ERROR_SAVING_GAME));
6464
}
6565
else
6666
{

src/Ext/Aircraft/Hooks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ DEFINE_HOOK(0x414F47, AircraftClass_AI_TrailerInheritOwner, 0x6)
9595
if (auto const pAnimExt = AnimExt::ExtMap.Find(pAnim))
9696
{
9797
pAnim->Owner = pThis->Owner;
98-
pAnimExt->Invoker = pThis;
98+
pAnimExt->SetInvoker(pThis);
9999
}
100100
}
101101

0 commit comments

Comments
 (0)