Skip to content

Commit

Permalink
Optimize when pos value is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
kagikn committed Jul 16, 2017
1 parent fcba81c commit a700cf9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions GlowingPickup/GlowingPickup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,20 @@ private void OnTick(object o, EventArgs e)
return;
}

var offset = (int)Game.Version >= (int)GameVersion.VER_1_0_944_2_STEAM ? 0x480 : 0x470;

foreach (var pickupAddr in PickupObjectPoolTask.GetPickupObjectAddresses())
{

var offset = (int)Game.Version >= (int)GameVersion.VER_1_0_944_2_STEAM ? 0x480 : 0x470;

unsafe
{
var pos = *(Vector3*)(pickupAddr + 0x90);

var isVisible = (Marshal.ReadByte(pickupAddr, 0x2C) & 0x01) == 1;

if (!isVisible)
{
continue;
}

var pos = *(Vector3*)(pickupAddr + 0x90);
var dataAddress = Marshal.ReadIntPtr(pickupAddr, offset);

if (dataAddress != IntPtr.Zero)
Expand Down

0 comments on commit a700cf9

Please sign in to comment.