Now I know this way may not be the most secure/effecient way to do this, but it will turn what would be a multiple hour project to be done in a matter of seconds. If you want to do it all manaully you can, but here is the quick easy way.
Open up a search box, go to modHandleData.
Search for CInt, replace all (in module) with CCInt
Search for CLng, replace all (in module) with CCLng
Search for CByte, replace all (in module) with CCByte
At the bottom add
Code:
Private Function CCInt(ByRef s As String) As Integer
' Make sure there is a valid string
If LenB(s) = 0 Then Exit Function
' Check if it's a number
If Not s Like "*[!0-9]*" Then
' Check for overflows
If s >= -32768 Then
If s <= 32767 Then
CCInt = CInt(s)
End If
End If
End If
End Function
Private Function CCLng(ByRef s As String) As Long
' Make sure there is a valid string
If LenB(s) = 0 Then Exit Function
' Check if it's a number
If Not s Like "*[!0-9]*" Then
' Check for overflows
If s >= -2147483468 Then
If s <= 2147483468 Then
CCLng = CLng(s)
End If
End If
End If
End Function
Private Function CCByte(ByRef s As String) As Byte
' Make sure there is a valid string
If LenB(s) = 0 Then Exit Function
' Check if it's a number
If Not s Like "*[!0-9]*" Then
' Check for overflows
If s >= 0 Then
If s <= 255 Then
CCByte = CByte(s)
End If
End If
End If
End Function
If you can find any problems please report them. Again I KNOW that this is not the best way to be doing this, but it is such a minuscule difference and I don't know about any of you but I don't want to spend a few hours adding these tedious checks. I would recommend someone doing just that for ms4 though
.
_________________
GIAKEN wrote:
I think what I see is this happening:
Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.