Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make RawX and RawY ints in MapLinkPayload #84

Merged
merged 1 commit into from
Apr 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Dalamud/Game/Chat/SeStringHandling/Payloads/MapLinkPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class MapLinkPayload : Payload
// pre-Resolve() values
public uint TerritoryTypeId { get; set; }
public uint MapId { get; set; }
public uint RawX { get; set; }
public uint RawY { get; set; }
public int RawX { get; set; }
public int RawY { get; set; }

// Resolved values
// It might make sense to have Territory be an external type, that has assorted relevant info
Expand All @@ -29,8 +29,8 @@ public override byte[] Encode()
// eventually we should allow creation using 'nice' values that then encode properly

var packedTerritoryAndMapBytes = MakePackedInteger(TerritoryTypeId, MapId);
var xBytes = MakeInteger(RawX);
var yBytes = MakeInteger(RawY);
var xBytes = MakeInteger((uint)RawX);
var yBytes = MakeInteger((uint)RawY);

var chunkLen = 4 + packedTerritoryAndMapBytes.Length + xBytes.Length + yBytes.Length;

Expand Down Expand Up @@ -68,8 +68,8 @@ public override void Resolve()
protected override void ProcessChunkImpl(BinaryReader reader, long endOfStream)
{
(TerritoryTypeId, MapId) = GetPackedIntegers(reader);
RawX = (uint)GetInteger(reader);
RawY = (uint)GetInteger(reader);
RawX = (int)GetInteger(reader);
RawY = (int)GetInteger(reader);
// the Z coordinate is never in this chunk, just the text (if applicable)

// seems to always be FF 01
Expand Down