From c6f2edda0613bc210aa9af29cb74eb02303ba714 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 6 Jul 2020 17:20:18 +0100 Subject: [PATCH] Script: Increase verbosity of compat script not found error message --- src/script/script_instance.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index 1ed808b590..e9bad5966c 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -137,7 +137,24 @@ bool ScriptInstance::LoadCompatibilityScripts(const char *api_version, Subdirect return false; } - ScriptLog::Warning("API compatibility script not found"); + const char *message_suffix; + switch (dir) { + case AI_DIR: + message_suffix = ", please check that the 'ai/' directory is properly installed"; + break; + + case GAME_DIR: + message_suffix = ", please check that the 'game/' directory is properly installed"; + break; + + default: + message_suffix = ""; + break; + } + + char not_found_msg[128]; + seprintf(not_found_msg, lastof(not_found_msg), "API compatibility script not found: %s%s", script_name, message_suffix); + ScriptLog::Warning(not_found_msg); return true; }