From 3491c37058e77ed5ca549c2589356293b92fd589 Mon Sep 17 00:00:00 2001 From: Qais Patankar Date: Fri, 4 Dec 2015 18:16:49 +0000 Subject: [PATCH] Improve setTrainTrack error messages --- MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Vehicle.cpp | 7 +++---- .../mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Vehicle.cpp b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Vehicle.cpp index 835b1fb301..5c2f0fc311 100644 --- a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Vehicle.cpp +++ b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Vehicle.cpp @@ -2063,11 +2063,10 @@ int CLuaFunctionDefs::SetTrainTrack ( lua_State* luaVM ) return 1; } } - m_pScriptDebugging->LogCustom ( luaVM, "track number should be between 0 and 3 inclusive" ); + argStream.SetCustomError ( "track number should be between 0 and 3 inclusive" ); } - else - m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); - + + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); lua_pushboolean ( luaVM, false ); return 1; } diff --git a/MTA10_Server/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp b/MTA10_Server/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp index 0918186b29..f31a597aa7 100644 --- a/MTA10_Server/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp +++ b/MTA10_Server/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp @@ -2784,11 +2784,10 @@ int CLuaVehicleDefs::SetTrainTrack ( lua_State* luaVM ) return 1; } } - m_pScriptDebugging->LogCustom ( luaVM, "track number should be between 0 and 3 inclusive" ); + argStream.SetCustomError ( "track number should be between 0 and 3 inclusive" ); } - else - m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); lua_pushboolean ( luaVM, false ); return 1; }