Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/compiler_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
# Sourcecode-launch - check first sys arg.
app_name = sys.argv.pop(1).casefold()

app_name = app_name.removesuffix('_osx').removesuffix('_linux').removesuffix('.exe')

if 'original' in app_name:
sys.exit('Original compilers replaced, verify game files in Steam!')
sys.exit('Original compilers were replaced! Please verify game files in Steam!')

if not app_name.startswith(('vbsp', 'vrad')):
sys.exit(f'Invalid application name: "{app_name}"! Filename must start with "vbsp" or "vrad" to set application behavior.')

if app_name not in ('vbsp', 'vrad'):
sys.exit(f'Unknown application name "{app_name}"!')
# Remove the latter half of the app_name after the initial valid application behavior checks have been done.
app_name = app_name.split(".")[0]
app_name = app_name.split("_")[0]

if app_name == 'vrad' and '--errorserver' in sys.argv:
app_name = 'error_server'
Expand All @@ -38,12 +40,12 @@
if app_name == 'vbsp':
import vbsp
func = vbsp.main
elif app_name == 'error_server':
import error_server
func = error_server.main
elif app_name == 'vrad':
import vrad
func = vrad.main
elif app_name == 'error_server':
import error_server
func = error_server.main
else:
raise AssertionError(app_name)

Expand Down
Loading