diff options
| author | Bob Blackmon <bob.blackmon@ymail.com> | 2017-04-03 11:04:55 -0400 |
|---|---|---|
| committer | Bob Blackmon <bob.blackmon@ymail.com> | 2017-04-03 11:04:55 -0400 |
| commit | 874da78491dd48478f85f087a4c24ef053ce41cb (patch) | |
| tree | f3551820d9d630ced7c1e521232cb4c390b55176 | |
| parent | 29224bc70179b9dcacd54ffd8d763fce776a4ca3 (diff) | |
| download | zones-874da78491dd48478f85f087a4c24ef053ce41cb.tar.gz zones-874da78491dd48478f85f087a4c24ef053ce41cb.tar.bz2 zones-874da78491dd48478f85f087a4c24ef053ce41cb.zip | |
Better versioning report
| -rw-r--r-- | lua/zones.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lua/zones.lua b/lua/zones.lua index 59412c9..7f9d785 100644 --- a/lua/zones.lua +++ b/lua/zones.lua @@ -1,5 +1,5 @@ -local version = 1.13 -- Older versions will not run if a newer version is used in another script. +local version = 1.131 -- Older versions will not run if a newer version is used in another script. --[[ ZONES - by Bobbleheadbob WARNING: If you edit any of these files, make them use a different namespace. Multiple scripts may depend on this library so modifying it can break other scripts. @@ -38,12 +38,23 @@ local version = 1.13 -- Older versions will not run if a newer version is used i local table, math, Vector, pairs, ipairs, ents = table, math, Vector, pairs, ipairs, ents if zones then + local diff = math.abs(math.floor(version)-math.floor(zones.version)) > 0 + if diff then + ErrorNoHalt("WARNING! Two scripts use VERY different versions of the zones API. Please tell one of them to update their script!\n") + end if zones.version > version then + if diff then + print("The outdated version of zones is located at: "..debug.getinfo(1,"S").short_src) + end print("A new version of zones exists. Using version "..zones.version.." instead of "..version) return elseif zones.version < version then + if diff then + print("The outdated version of zones is located at: "..debug.getinfo(zones.RegisterClass,"S").short_src) + end print("A new version of zones exists. Using version "..version.." instead of "..zones.version) end + else print("Loaded zones " ..version) end |
