diff --git a/src/config/migrator.zig b/src/config/migrator.zig index 48b1354..229007c 100644 --- a/src/config/migrator.zig +++ b/src/config/migrator.zig @@ -165,23 +165,16 @@ pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniFie if (std.mem.startsWith(u8, field.header, "cmd:")) { const key = field.header[4..]; - const keyZ = temporary_allocator.dupe(u8, key) catch |e| - std.debug.panic("CustomCommands.binds: {} while duping key {s}", .{e, key}); + const keyZ = temporary_allocator.dupe(u8, key) catch ""; if (!CustomCommands.binds.contains(key)) { - CustomCommands.binds.put(keyZ, .{}) catch |e| { - std.debug.panic("CustomCommands.binds: {} while putting for key {s}", .{e, key}); - }; + CustomCommands.binds.put(keyZ, .{}) catch {}; } if (CustomCommands.binds.getPtr(keyZ)) |command| { if (std.mem.eql(u8, field.key, "name")) { - command.name = temporary_allocator.dupe(u8, field.value) catch |e| { - std.debug.panic("CustomCommands.binds: {} while duping name '{s}'", .{e, field.value}); - }; + command.name = temporary_allocator.dupe(u8, field.value) catch ""; } if (std.mem.eql(u8, field.key, "cmd")) { - command.cmd = temporary_allocator.dupe(u8, field.value) catch |e| { - std.debug.panic("CustomCommands.binds: {} while duping command '{s}", .{e, field.value}); - }; + command.cmd = temporary_allocator.dupe(u8, field.value) catch ""; } if (std.mem.eql(u8, field.key, "posX")) { command.posX = std.fmt.parseInt(u32, field.value, 10) catch blk: { break :blk 0; }; @@ -194,20 +187,15 @@ pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniFie if (std.mem.startsWith(u8, field.header, "lbl:")) { const key = field.header[4..]; - const keyZ = temporary_allocator.dupe(u8, key) catch |e| - std.debug.panic("CustomCommands.labels: {} while duping key {s}", .{e, key}); + const keyZ = temporary_allocator.dupe(u8, key) catch ""; if (!CustomCommands.labels.contains(keyZ)) { CustomCommands.labels.put(keyZ, .{ .name = keyZ - }) catch |e| { - std.debug.panic("CustomCommands.labels: {} while putting for key {s}", .{e, key}); - }; + }) catch {}; } if (CustomCommands.labels.getPtr(keyZ)) |label| { if (std.mem.eql(u8, field.key, "cmd")) { - label.cmd = temporary_allocator.dupe(u8, field.value) catch |e| { - std.debug.panic("CustomCommands.labels: {} while duping command '{s}'", .{e, field.value}); - }; + label.cmd = temporary_allocator.dupe(u8, field.value) catch ""; } if (std.mem.eql(u8, field.key, "posX")) { label.posX = std.fmt.parseInt(u32, field.value, 10) catch blk: { break :blk 0; };