-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate bot and client healthcontrollers
- Improved bot spawn coroutine as well
- Loading branch information
Showing
3 changed files
with
59 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// © 2024 Lacyway All Rights Reserved | ||
|
||
using EFT; | ||
using EFT.HealthSystem; | ||
using EFT.UI; | ||
using Fika.Core.Coop.Players; | ||
|
||
namespace Fika.Core.Coop.ClientClasses | ||
{ | ||
public sealed class CoopBotHealthController(Profile.GClass1756 healthInfo, Player player, InventoryControllerClass inventoryController, SkillManager skillManager, bool aiHealth) | ||
: PlayerHealthController(healthInfo, player, inventoryController, skillManager, aiHealth) | ||
{ | ||
private readonly CoopBot coopBot = (CoopBot)player; | ||
public override bool _sendNetworkSyncPackets | ||
{ | ||
get | ||
{ | ||
return true; | ||
} | ||
} | ||
|
||
public override void SendNetworkSyncPacket(GStruct346 packet) | ||
{ | ||
if (packet.SyncType == GStruct346.ESyncType.IsAlive && !packet.Data.IsAlive.IsAlive) | ||
{ | ||
coopBot?.PacketSender?.HealthSyncPackets.Enqueue(coopBot.SetupDeathPacket(packet)); | ||
return; | ||
} | ||
|
||
coopBot?.PacketSender?.HealthSyncPackets.Enqueue(new(coopBot.NetId) | ||
{ | ||
Packet = packet | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters