Skip to content

Commit

Permalink
Merge branch 'merge' into mergeWIP
Browse files Browse the repository at this point in the history
  • Loading branch information
CarnifexOptimus committed Dec 30, 2024
2 parents 7ab091c + 928d62a commit f0f76b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
7 changes: 5 additions & 2 deletions BossMod/ActionTweaks/CancelCastTweak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ private bool WantCancel()
return false;

var cast = _ws.Party.Player()?.CastInfo;
var target = _ws.Actors.Find(cast?.TargetID ?? 0);
if (cast == null || cast.Action.Type == ActionType.KeyItem) // don't auto cancel quest items, that's never a good idea
return false;

var target = _ws.Actors.Find(cast.TargetID);
if (target == null)
return false;

var isRaise = Service.LuminaRow<Lumina.Excel.Sheets.Action>(cast?.Action.SpellId() ?? 0)?.DeadTargetBehaviour == 1;
var isRaise = Service.LuminaRow<Lumina.Excel.Sheets.Action>(cast.Action.SpellId())?.DeadTargetBehaviour == 1;
if (!isRaise)
return target.IsDead;

Expand Down
5 changes: 1 addition & 4 deletions BossMod/Data/ActorState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,6 @@ public sealed record class OpEventNpcYell(ulong InstanceID, ushort Message) : Op
public sealed record class OpEventOpenTreasure(ulong InstanceID) : Operation(InstanceID)
{
protected override void ExecActor(WorldState ws, Actor actor) => ws.Actors.EventOpenTreasure.Fire(actor);
public override void Write(ReplayRecorder.Output output)
{
output.EmitFourCC("OPNT"u8).EmitActor(InstanceID);
}
public override void Write(ReplayRecorder.Output output) => output.EmitFourCC("OPNT"u8).EmitActor(InstanceID);
}
}
1 change: 1 addition & 0 deletions BossMod/Framework/WorldStateGameSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ private unsafe void ProcessPacketRSVDataDetour(byte* packet)
_processPacketRSVDataHook.Original(packet);
_globalOps.Add(new WorldState.OpRSVData(MemoryHelper.ReadStringNullTerminated((nint)(packet + 4)), MemoryHelper.ReadString((nint)(packet + 0x34), *(int*)packet)));
}

private unsafe void ProcessPacketOpenTreasureDetour(uint actorID, byte* packet)
{
_processPacketOpenTreasureHook.Original(actorID, packet);
Expand Down
1 change: 1 addition & 0 deletions BossMod/Replay/ReplayParserLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ private WorldState.OpEnvControl ParseEnvControl()
_input.ReadUInt(true);
return new(_input.ReadByte(true), _input.ReadUInt(true));
}

private WorldState.OpSystemLogMessage ParseSystemLog()
{
var id = _input.ReadUInt(false);
Expand Down

0 comments on commit f0f76b4

Please sign in to comment.