Skip to content
Browse files

[modScripting] Script system loading robustness

- It will attempt to convert script files loaded with LF line endings
  to use CRLF so that pre-processing #include works.
- Line ending normalization will only be attempted once during a load
  for each file, by a recursion check.
- This can fail if, for example, the script is set to read only in the OS.

- Long file names in #include errors are now cut off after 100 characters.
- Egregiously invalid file names in #include no longer break the script
  system and are treated correctly as "not found".

- Un-accounted-for other errors with pre-processing and preparing
  modules will now be thrown as error messages which will attempt to
  display the file name.

- Fixed an issue with SC_Error and Event_Error where the recursion check
  was always unset because an array was accessed before assignment in

- Function-level RTE protection for scripting system now use the same
  display format for error messages.
  • Loading branch information...
nmbook committed Dec 6, 2017
1 parent a7c1ae0 commit 90fce725c2263f0f3e1db903e06b96429db4a904
Showing with 120 additions and 58 deletions.
  1. +2 −2 trunk/frmChat.frm
  2. +118 −56 trunk/modScripting.bas
@@ -6893,7 +6893,7 @@ Function AddQ(ByVal Message As String, Optional msg_priority As Integer = -1, _
Exit Function

Call AddChat(vbRed, "Error: " & Err.Description & " in AddQ().")
Call AddChat(vbRed, "Error (#" & Err.Number & "): " & Err.Description & " in AddQ().")

Exit Function
End Function
@@ -8221,7 +8221,7 @@ Public Sub AddName(ByVal UserObj As clsUserObj, Optional ByVal OldPosition As In

Exit Sub
AddChat g_Color.ErrorMessageText, StringFormat("Error: #{0}: {1} in frmChat.AddName", Err.Number, Err.Description)
AddChat g_Color.ErrorMessageText, StringFormat("Error (#{0}): {1} in frmChat.AddName", Err.Number, Err.Description)
End Sub

Private Sub AddFriendItem(ByVal Name As String, ByVal Game As String, _

0 comments on commit 90fce72

Please sign in to comment.
You can’t perform that action at this time.