Skip to content

Commit 3491c37

Browse files
committed
Improve setTrainTrack error messages
1 parent f7d8522 commit 3491c37

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Vehicle.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,11 +2063,10 @@ int CLuaFunctionDefs::SetTrainTrack ( lua_State* luaVM )
20632063
return 1;
20642064
}
20652065
}
2066-
m_pScriptDebugging->LogCustom ( luaVM, "track number should be between 0 and 3 inclusive" );
2066+
argStream.SetCustomError ( "track number should be between 0 and 3 inclusive" );
20672067
}
2068-
else
2069-
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
2070-
2068+
2069+
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
20712070
lua_pushboolean ( luaVM, false );
20722071
return 1;
20732072
}

MTA10_Server/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2784,11 +2784,10 @@ int CLuaVehicleDefs::SetTrainTrack ( lua_State* luaVM )
27842784
return 1;
27852785
}
27862786
}
2787-
m_pScriptDebugging->LogCustom ( luaVM, "track number should be between 0 and 3 inclusive" );
2787+
argStream.SetCustomError ( "track number should be between 0 and 3 inclusive" );
27882788
}
2789-
else
2790-
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
27912789

2790+
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
27922791
lua_pushboolean ( luaVM, false );
27932792
return 1;
27942793
}

0 commit comments

Comments
 (0)