From c21d34a166bc71bb0a21174f6d5a9f7cc4956942 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 6 Jan 2024 05:55:49 -0500 Subject: [PATCH] Better Fix --- src/struct.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/struct.ts b/src/struct.ts index 55a319b..f89fd96 100644 --- a/src/struct.ts +++ b/src/struct.ts @@ -190,8 +190,11 @@ export class Struct { } else if (i === this.#properties.length) { // End Of Structure Padding if (this.#size !== null && lastProperty) { - const realSize = this.#roundSize(lastProperty.propertyOffset() + lastProperty.propertySize()); - neededPadding = this.#size - realSize; + const realSize = lastProperty.propertyOffset() + lastProperty.propertySize(); + const realRoundedSize = this.#roundSize(realSize); + if (realRoundedSize !== this.#size) { + neededPadding = this.#size - realSize; + } } } else { // Inner Structure Padding