Skip to content

Commit

Permalink
Use FormerRegister in PeekRegister, drop ExitZone, fix CI warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymonKaminski committed Feb 9, 2025
1 parent 8b2e841 commit cd8fb1d
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 38 deletions.
3 changes: 0 additions & 3 deletions UdpHosts/GameServer/NetworkClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ private void Matrix_PacketAvailable(GamePacket packet)
Factory.Get<BaseController>().Init(this, Player, AssignedShard, Logger);
Player.EnterZoneAck();
break;
case MatrixPacketType.ExitZone:
NetChannels[ChannelType.Matrix].SendMessage(new ExitZone());
break;
case MatrixPacketType.ExitZoneAck:
Player.ExitZoneAck();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public SendTipMessageCommand(SendTipMessageCommandDef par)
public bool Execute(Context context)
{
// var message = new SendTipMessage() { };

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PeekRegisterCommand(PeekRegisterCommandDef par)

public bool Execute(Context context)
{
context.Register = AbilitySystem.RegistryOp(context.Register, context.Register, (Operand)Params.Regop);
context.Register = AbilitySystem.RegistryOp(context.Register, context.FormerRegister, (Operand)Params.Regop);

return context.Register != 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,32 @@ public bool Execute(Context context)
result = true;
}
}
// else
// {
// var target = context.Self;
// foreach (EffectState active in target.GetActiveEffects())
// {
// if (active == null)
// {
// continue;
// }
//
// if (active.Effect.Id == Params.EffectId && active.Stacks >= Params.StackCount)
// {
// result = true;
//
// if (Params.SameInitiator == 1 && context.Initiator != active.Context.Initiator)
// {
// result = false;
// }
//
// break;
// }
// }
// }

/*
else
{
var target = context.Self;
foreach (EffectState active in target.GetActiveEffects())
{
if (active == null)
{
continue;
}
if (active.Effect.Id == Params.EffectId && active.Stacks >= Params.StackCount)
{
result = true;
if (Params.SameInitiator == 1 && context.Initiator != active.Context.Initiator)
{
result = false;
}
break;
}
}
}
*/

if (Params.Negate == 1)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using GameServer.Data.SDB.Records.apt;
using System;
using GameServer.Data.SDB.Records.apt;

namespace GameServer.Aptitude;

Expand All @@ -18,6 +19,7 @@ public bool Execute(Context context)
if (Params.Former == 1 && context.FormerTargets.Count > 0)
{
// assuming push == saving for later, this shouldnt occur and it doesnt in 1962
Console.WriteLine($"[PushTargets] Former = 1, FormerTargets count {context.FormerTargets.Count}");
}

if (Params.Current == 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public TargetByEffectCommand(TargetByEffectCommandDef par)
public bool Execute(Context context)
{
// todo Params.FilterList, equal to 1 in 1086 instances, 0 in 6 instances
var result = false;
var previousTargets = context.Targets;
var newTargets = new AptitudeTargets();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ public bool Execute(Context context)

context.FormerTargets = new AptitudeTargets(context.Targets);

// foreach (var npc in player.OwnedNPCs)
// {
// context.Targets.Push(npc);
// }
/*
foreach (var npc in player.OwnedNPCs)
{
context.Targets.Push(npc);
}
*/

return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using GameServer.Data.SDB.Records.aptfs;
using GameServer.Entities.Deployable;
using GameServer.Entities.Thumper;
using GameServer.Entities.Vehicle;

namespace GameServer.Aptitude;

Expand All @@ -24,11 +21,11 @@ public bool Execute(Context context)

foreach (var target in previousTargets)
{
// add || (target is hostile)
if (
(target == context.Self && Params.IncludeSelf == 0)
|| (target == context.Initiator && Params.IncludeInitiator == 0)
|| (target == context.Self.Owner && Params.IncludeOwner == 0))
/* || (target is hostile) */
{
continue;
}
Expand Down

0 comments on commit cd8fb1d

Please sign in to comment.