Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 2e78fe9

Browse files
committed
Fix for srcds
At least I hope this only affected srcds. Made it check first if GarrysMod/bin contains lua_shared.dll in it. If not, then ignore and try and look for GarrysMod/garrysmod/bin. *And yes.* I tested it this time, works with gm_rhai. never gonna push without testing locally again smh
1 parent f8007ff commit 2e78fe9

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/lib.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,11 @@ pub static GMOD_DIR: Lazy<PathBuf> = Lazy::new(|| {
142142
std::env::current_dir().expect("Couldn't get current running directory.") // D:\SteamLibrary\steamapps\common\GarrysMod for example.
143143
});
144144

145+
/// Where the lua_shared file binary is.
145146
pub static BIN_DIR: Lazy<PathBuf> = Lazy::new(|| {
146147
let gm_dir = &*GMOD_DIR;
147148
match gm_dir.join("bin") {
148-
bin if bin.exists() => bin, // GarrysMod/bin
149+
bin if bin.exists() & bin.join("lua_shared.dll").exists() => bin, // GarrysMod/bin
149150
_ => {
150151
let garrysmod_bin = gm_dir.join("garrysmod").join("bin");
151152
if !garrysmod_bin.exists() {
@@ -170,14 +171,20 @@ pub static LUA_SHARED_PATH: Lazy<Option<PathBuf>> = Lazy::new(|| {
170171

171172
return match full.exists() {
172173
true => Some(full),
173-
false => None
174+
false => {
175+
eprintln!("x64, {}", full.display());
176+
None
177+
}
174178
}
175179
} else {
176180
// x86 Platform
177181
let game_full = game_bin.join("lua_shared.dll");
178182
return match game_full.exists() {
179183
true => Some(game_full),
180-
false => None
184+
false => {
185+
eprintln!("game_full, {}", game_full.display());
186+
None
187+
}
181188
}
182189
}
183190
});

0 commit comments

Comments
 (0)