Skip to content

Commit 3cdf95c

Browse files
authored
Merge pull request #772 from starfi5h/pr-update
Fix compatibility with game version 0.10.34.28518
2 parents a7419f3 + f37ded8 commit 3cdf95c

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Changelog
22

3+
0.9.22:
4+
- Compatible with game version 0.10.34.28518
5+
36
0.9.21:
47
- Compatible with game version 0.10.34.28470
58

NebulaModel/Packets/Factory/KillEntityRequest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ public class KillEntityRequest
44
{
55
public KillEntityRequest() { }
66

7-
public KillEntityRequest(int planetId, int objId)
7+
public KillEntityRequest(int planetId, int objId, bool spawnPrebuild)
88
{
99
PlanetId = planetId;
1010
ObjId = objId;
11+
SpawnPrebuild = spawnPrebuild;
1112
}
1213

1314
public int PlanetId { get; set; }
1415
public int ObjId { get; set; }
16+
public bool SpawnPrebuild { get; set; }
1517
}

NebulaNetwork/PacketProcessors/Factory/KillEntityRequestProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected override void ProcessPacket(KillEntityRequest packet, NebulaConnection
3838
ref var entityPtr = ref factory.entityPool[packet.ObjId];
3939
if (entityPtr.id == packet.ObjId)
4040
{
41-
factory.KillEntityFinally(GameMain.mainPlayer, packet.ObjId, ref CombatStat.empty);
41+
factory.KillEntityFinally(GameMain.mainPlayer, packet.ObjId, ref CombatStat.empty, packet.SpawnPrebuild);
4242
}
4343

4444
Multiplayer.Session.Factories.TargetPlanet = NebulaModAPI.PLANET_NONE;

NebulaPatcher/Patches/Dynamic/PlanetFactory_Patch.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ public static bool RemoveEnemyFinal_Prefix()
757757

758758
[HarmonyPrefix]
759759
[HarmonyPatch(nameof(PlanetFactory.KillEntityFinally))]
760-
public static bool KillEntityFinally_Prefix(PlanetFactory __instance, int objId)
760+
public static bool KillEntityFinally_Prefix(PlanetFactory __instance, int objId, bool spawnPrebuild)
761761
{
762762
if (!Multiplayer.IsActive || objId <= 0)
763763
{
@@ -769,7 +769,7 @@ public static bool KillEntityFinally_Prefix(PlanetFactory __instance, int objId)
769769
return Multiplayer.Session.Factories.IsIncomingRequest.Value;
770770
}
771771

772-
var packet = new KillEntityRequest(__instance.planetId, objId);
772+
var packet = new KillEntityRequest(__instance.planetId, objId, spawnPrebuild);
773773
var starId = __instance.planet.star.id;
774774
Multiplayer.Session.Server.SendPacketToStar(packet, starId);
775775
return true;

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "0.9.21",
3+
"version": "0.9.22",
44
"assemblyVersion": {
55
"precision": "build"
66
},

0 commit comments

Comments
 (0)