Injector: Ensure first reads are valid

# Don't pull 0 from the saved/default settings
This commit is contained in:
DESKTOP-SN9KF5O\Strawberry 2026-01-30 03:12:14 +00:00
parent 076d113a4d
commit 7dff777997

View File

@ -22,12 +22,11 @@ public SysBotUI(AutoInjector injector, SysBotController c, AutoInjector injector
InjectorUSB = injectorUSB;
var offset = Bot.GetDefaultOffset();
offset = offset > 0 ? offset : StringUtil.GetHexValue(RamOffset.Text);
Injector.SetWriteOffset(offset);
if (string.IsNullOrWhiteSpace(RamOffset.Text))
RamOffset.Text = offset.ToString("X8");
if (string.IsNullOrWhiteSpace(RamOffsetUSB.Text))
RamOffsetUSB.Text = offset.ToString("X8");
RamOffset.Text = offset.ToString("X8");
RamOffsetUSB.Text = offset.ToString("X8");
TB_IP.Text = Bot.IP;
TB_Port.Text = Bot.Port;