Skip to content

Commit

Permalink
change connected to a regular bool
Browse files Browse the repository at this point in the history
  • Loading branch information
OneAvargeCoder193 committed Jan 26, 2025
1 parent 6052bd6 commit 6ac396c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/game.zig
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ pub const World = struct { // MARK: World
milliTime: i64,
gameTime: Atomic(i64) = .init(0),
spawn: Vec3f = undefined,
connected: Atomic(bool) = .init(false),
connected: bool = true,
blockPalette: *assets.Palette = undefined,
biomePalette: *assets.Palette = undefined,
itemDrops: ClientItemDropManager = undefined,
Expand All @@ -534,7 +534,6 @@ pub const World = struct { // MARK: World
.name = "client",
.milliTime = std.time.milliTimestamp(),
};
self.connected.store(true, .monotonic);

self.itemDrops.init(main.globalAllocator, self);
network.Protocols.handShake.clientSide(self.conn, settings.playerName);
Expand All @@ -550,7 +549,7 @@ pub const World = struct { // MARK: World
pub fn deinit(self: *World) void {
self.conn.deinit();

self.connected.store(false, .monotonic);
self.connected = false;

// TODO: Close all world related guis.
main.gui.inventory.deinit();
Expand Down Expand Up @@ -589,7 +588,7 @@ pub const World = struct { // MARK: World
}

pub fn isConnected(self: *World) bool {
return self.connected.load(.monotonic);
return self.connected;
}

pub fn update(self: *World) void {
Expand Down

0 comments on commit 6ac396c

Please sign in to comment.