From: Brendan Hansen Date: Fri, 23 Jun 2023 02:02:53 +0000 (-0500) Subject: updated with new Onyx version X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=ca7b6ee6e7c269ed162f05e5423b1013934696ce;p=voxel-shooter.git updated with new Onyx version --- diff --git a/onyx-pkg.ini b/onyx-pkg.ini index a0f136c..dbce314 100644 --- a/onyx-pkg.ini +++ b/onyx-pkg.ini @@ -1,20 +1,14 @@ [metadata] name=voxel-shooter description=Ace Of Spades style shooter game -url= author=Brendan Hansen version=0.0.1 [config] lib_source_directory=./lib lib_bin_directory=./run_tree/lib -run_cmd= -debug_cmd= -test_cmd= [native_library] -build_cmd= -library= [dependencies] git://onyxlang.io/repo/onyx-net=0.0.7 diff --git a/run_tree/run.sh b/run_tree/run.sh index 47e6fbe..6a67e22 100755 --- a/run_tree/run.sh +++ b/run_tree/run.sh @@ -1,6 +1,6 @@ case "$1" in - build) onyx build -V build -I ../src/client -o game.wasm $@ ;; + build) onyx build -V build -I ../src/client -o game.wasm --tag $@ ;; watch) onyx watch build.onyx -I ../src/client ;; debug) onyx run --debug game.wasm ;; *) onyx run game.wasm ;; diff --git a/src/client/build.onyx b/src/client/build.onyx index 5fc9521..1757b26 100644 --- a/src/client/build.onyx +++ b/src/client/build.onyx @@ -2,7 +2,7 @@ #library_path "./lib" // Primary source files -#load "./../src/config" +#load "./../config" #load_all "./." #load_all "./gfx" @@ -14,4 +14,4 @@ #load_all "./../shared" // Onyx modules -#load "./../lib/packages" +#load "./../../lib/packages" diff --git a/src/client/net/net.onyx b/src/client/net/net.onyx index a984d02..e537bd0 100644 --- a/src/client/net/net.onyx +++ b/src/client/net/net.onyx @@ -56,8 +56,9 @@ Packet_Handler :: struct { #local handle_packet :: (packet_data: [] u8) { packet := cast(^packets.Packet_Base) packet_data.data; - if packet_handles[~~ packet.type] != null_proc { - packet_handles[~~ packet.type](packet); + handler := packet_handles[~~ packet.type] ?? null_proc; + if handler != null_proc { + handler(packet); } }